private JsonValue readValue() throws IOException { switch(current) { case '\'': case '"': return readString(); case '[': return readArray(); case '{': return readObject(false); default: return readTfnns(); } }
private JsonValue readValue() throws IOException { switch(current) { case '\'': case '"': return readString(); case '[': return readArray(); case '{': return readObject(false); default: return readTfnns(); } }
JsonValue parse() throws IOException { // Braces for the root object are optional read(); skipWhiteSpace(); if (legacyRoot) { switch (current) { case '[': case '{': return checkTrailing(readValue()); default: try { // assume we have a root object without braces return checkTrailing(readObject(true)); } catch (Exception exception) { // test if we are dealing with a single JSON value instead (true/false/null/num/"") reset(); read(); skipWhiteSpace(); try { return checkTrailing(readValue()); } catch (Exception exception2) { } throw exception; // throw original error } } } else { return checkTrailing(readValue()); } }
JsonValue parse() throws IOException { // Braces for the root object are optional read(); skipWhiteSpace(); if (legacyRoot) { switch (current) { case '[': case '{': return checkTrailing(readValue()); default: try { // assume we have a root object without braces return checkTrailing(readObject(true)); } catch (Exception exception) { // test if we are dealing with a single JSON value instead (true/false/null/num/"") reset(); read(); skipWhiteSpace(); try { return checkTrailing(readValue()); } catch (Exception exception2) { } throw exception; // throw original error } } } else { return checkTrailing(readValue()); } }