/** * Inserts any necessary separators and whitespace before a name. Also * adjusts the stack to expect the name's value. */ private void beforeName() throws IOException { int context = peekScope(); if (context == NONEMPTY_OBJECT) { // first in object sink.writeByte(','); } else if (context != EMPTY_OBJECT) { // not in an object! throw new IllegalStateException("Nesting problem."); } newline(); replaceTop(DANGLING_NAME); }
replaceTop(NONEMPTY_DOCUMENT); break; replaceTop(NONEMPTY_ARRAY); newline(); break; replaceTop(NONEMPTY_OBJECT); break;
/** * Inserts any necessary separators and whitespace before a name. Also * adjusts the stack to expect the name's value. */ private void beforeName() throws IOException { int context = peekScope(); if (context == NONEMPTY_OBJECT) { // first in object sink.writeByte(','); } else if (context != EMPTY_OBJECT) { // not in an object! throw new IllegalStateException("Nesting problem."); } newline(); replaceTop(DANGLING_NAME); }
/** * Inserts any necessary separators and whitespace before a name. Also * adjusts the stack to expect the name's value. */ private void beforeName() throws IOException { int context = peekScope(); if (context == NONEMPTY_OBJECT) { // first in object sink.writeByte(','); } else if (context != EMPTY_OBJECT) { // not in an object! throw new IllegalStateException("Nesting problem."); } newline(); replaceTop(DANGLING_NAME); }
replaceTop(NONEMPTY_DOCUMENT); break; replaceTop(NONEMPTY_ARRAY); newline(); break; replaceTop(NONEMPTY_OBJECT); break;
replaceTop(NONEMPTY_DOCUMENT); break; replaceTop(NONEMPTY_ARRAY); newline(); break; replaceTop(NONEMPTY_OBJECT); break;