skipWhiteSpace(); if (!isEndOfText()) { throw error("Unexpected character");
private void readArray() throws IOException { Object array = handler.startArray(); read(); if (++nestingLevel > MAX_NESTING_LEVEL) { throw error("Nesting too deep"); } skipWhiteSpace(); if (readChar(']')) { nestingLevel--; handler.endArray(array); return; } do { skipWhiteSpace(); handler.startArrayValue(array); readValue(); handler.endArrayValue(array); skipWhiteSpace(); } while (readChar(',')); if (!readChar(']')) { throw expected("',' or ']'"); } nestingLevel--; handler.endArray(array); }
private void read() throws IOException { if( isEndOfText() ) { throw error( "Unexpected end of input" ); } if( index == fill ) { if( captureStart != -1 ) { captureBuffer.append( buffer, captureStart, fill - captureStart ); captureStart = 0; } bufferOffset += fill; fill = reader.read( buffer, 0, buffer.length ); index = 0; if( fill == -1 ) { current = -1; return; } } if( current == '\n' ) { line++; lineOffset = bufferOffset + index; } current = buffer[index++]; }
read(); if (++nestingLevel > MAX_NESTING_LEVEL) { throw error("Nesting too deep");
JsonValue parse() throws IOException { read(); skipWhiteSpace(); JsonValue result = readValue(); skipWhiteSpace(); if( !isEndOfText() ) { throw error( "Unexpected character" ); } return result; }
skipWhiteSpace(); if (!isEndOfText()) { throw error("Unexpected character");
skipWhiteSpace(); if (!isEndOfText()) { throw error("Unexpected character");
private void readArray() throws IOException { Object array = handler.startArray(); read(); if (++nestingLevel > MAX_NESTING_LEVEL) { throw error("Nesting too deep"); } skipWhiteSpace(); if (readChar(']')) { nestingLevel--; handler.endArray(array); return; } do { skipWhiteSpace(); handler.startArrayValue(array); readValue(); handler.endArrayValue(array); skipWhiteSpace(); } while (readChar(',')); if (!readChar(']')) { throw expected("',' or ']'"); } nestingLevel--; handler.endArray(array); }
private void readArray() throws IOException { Object array = handler.startArray(); read(); if (++nestingLevel > MAX_NESTING_LEVEL) { throw error("Nesting too deep"); } skipWhiteSpace(); if (readChar(']')) { nestingLevel--; handler.endArray(array); return; } do { skipWhiteSpace(); handler.startArrayValue(array); readValue(); handler.endArrayValue(array); skipWhiteSpace(); } while (readChar(',')); if (!readChar(']')) { throw expected("',' or ']'"); } nestingLevel--; handler.endArray(array); }
read(); if (++nestingLevel > MAX_NESTING_LEVEL) { throw error("Nesting too deep");
read(); if (++nestingLevel > MAX_NESTING_LEVEL) { throw error("Nesting too deep");