private void readRequiredChar(char ch) throws IOException { if (!readChar(ch)) { throw expected("'" + ch + "'"); } }
private String readName() throws IOException { if (current != '"') { throw expected("name"); } return readStringInternal(); }
private boolean readFraction() throws IOException { if (!readChar('.')) { return false; } if (!readDigit()) { throw expected("digit"); } while (readDigit()) { } return true; }
private boolean readExponent() throws IOException { if (!readChar('e') && !readChar('E')) { return false; } if (!readChar('+')) { readChar('-'); } if (!readDigit()) { throw expected("digit"); } while (readDigit()) { } return true; }
private String readStringInternal() throws IOException { read(); startCapture(); while (current != '"') { if (current == '\\') { pauseCapture(); readEscape(); startCapture(); } else if (current < 0x20) { throw expected("valid string character"); } else { read(); } } String string = endCapture(); read(); return string; }
private void readNumber() throws IOException { handler.startNumber(); startCapture(); readChar('-'); int firstDigit = current; if (!readDigit()) { throw expected("digit"); } if (firstDigit != '0') { while (readDigit()) { } } readFraction(); readExponent(); handler.endNumber(endCapture()); }
break; default: throw expected("value");
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 String readName() throws IOException { if (current != '"') { throw expected("name"); } return readStringInternal(); }
private void readRequiredChar(char ch) throws IOException { if (!readChar(ch)) { throw expected("'" + ch + "'"); } }
private String readName() throws IOException { if (current != '"') { throw expected("name"); } return readStringInternal(); }
private void readRequiredChar( char ch ) throws IOException { if( !readChar( ch ) ) { throw expected( "'" + ch + "'" ); } }
private void readRequiredChar(char ch) throws IOException { if (!readChar(ch)) { throw expected("'" + ch + "'"); } }
private String readName() throws IOException { if( current != '"' ) { throw expected( "name" ); } return readStringInternal(); }
private boolean readFraction() throws IOException { if (!readChar('.')) { return false; } if (!readDigit()) { throw expected("digit"); } while (readDigit()) { } return true; }
private boolean readFraction() throws IOException { if (!readChar('.')) { return false; } if (!readDigit()) { throw expected("digit"); } while (readDigit()) { } return true; }
private boolean readFraction() throws IOException { if( !readChar( '.' ) ) { return false; } if( !readDigit() ) { throw expected( "digit" ); } while( readDigit() ) { } return true; }
private boolean readExponent() throws IOException { if (!readChar('e') && !readChar('E')) { return false; } if (!readChar('+')) { readChar('-'); } if (!readDigit()) { throw expected("digit"); } while (readDigit()) { } return true; }