private boolean readChar(char ch) throws IOException { if (current != ch) { return false; } read(); return true; }
private void readFalse() throws IOException { handler.startBoolean(); read(); readRequiredChar('a'); readRequiredChar('l'); readRequiredChar('s'); readRequiredChar('e'); handler.endBoolean(false); }
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 readObject() throws IOException { Object object = handler.startObject(); read(); if (++nestingLevel > MAX_NESTING_LEVEL) { throw error("Nesting too deep");
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); }
current = 0; captureStart = -1; read(); skipWhiteSpace(); readValue();
private void readTrue() throws IOException { handler.startBoolean(); read(); readRequiredChar('r'); readRequiredChar('u'); readRequiredChar('e'); handler.endBoolean(true); }
private boolean readDigit() throws IOException { if (!isDigit()) { return false; } read(); return true; }
private void readNull() throws IOException { handler.startNull(); read(); readRequiredChar('u'); readRequiredChar('l'); readRequiredChar('l'); handler.endNull(); }
private void skipWhiteSpace() throws IOException { while (isWhiteSpace()) { read(); } }
private void readFalse() throws IOException { handler.startBoolean(); read(); readRequiredChar('a'); readRequiredChar('l'); readRequiredChar('s'); readRequiredChar('e'); handler.endBoolean(false); }
private void readNull() throws IOException { handler.startNull(); read(); readRequiredChar('u'); readRequiredChar('l'); readRequiredChar('l'); handler.endNull(); }
private boolean readChar(char ch) throws IOException { if (current != ch) { return false; } read(); return true; }
private void readTrue() throws IOException { handler.startBoolean(); read(); readRequiredChar('r'); readRequiredChar('u'); readRequiredChar('e'); handler.endBoolean(true); }
private boolean readChar(char ch) throws IOException { if (current != ch) { return false; } read(); return true; }
private void readTrue() throws IOException { handler.startBoolean(); read(); readRequiredChar('r'); readRequiredChar('u'); readRequiredChar('e'); handler.endBoolean(true); }
private void skipWhiteSpace() throws IOException { while (isWhiteSpace()) { read(); } }
private boolean readDigit() throws IOException { if (!isDigit()) { return false; } read(); return true; }
private boolean readDigit() throws IOException { if (!isDigit()) { return false; } read(); return true; }