/** * Checks the current character, making sure that it is the expected character. * * @param ch the character expected * @throws JSONParseException if the current character does not match the given character */ public boolean check(final char ch) { return get() == ch; }
get(); int start = this.pos; boolean isDouble = false;
pos++; char x = get();
/** * Parses an object for the form <i>{}</i> and <i>{ members }</i>. * * @return DBObject the next object * @throws JSONParseException if invalid JSON is found */ protected Object parseObject(final String name) { if (name != null) { _callback.objectStart(name); } else { _callback.objectStart(); } read('{'); char current = get(); while (get() != '}') { String key = parseString(false); read(':'); Object value = parse(key); doCallback(key, value); if ((current = get()) == ',') { read(','); } else { break; } } read('}'); return _callback.objectDone(); }
/** * Parses the next array. * * @return the array * @throws JSONParseException if invalid JSON is found */ protected Object parseArray(final String name) { if (name != null) { _callback.arrayStart(name); } else { _callback.arrayStart(); } read('['); int i = 0; char current = get(); while (current != ']') { String elemName = String.valueOf(i++); Object elem = parse(elemName); doCallback(elemName, elem); if ((current = get()) == ',') { read(','); } else if (current == ']') { break; } else { throw new JSONParseException(s, pos); } } read(']'); return _callback.arrayDone(); }
char current = get();
/** * Checks the current character, making sure that it is the expected character. * * @param ch the character expected * @throws JSONParseException if the current character does not match the given character */ public boolean check(final char ch) { return get() == ch; }
get(); int start = this.pos; boolean isDouble = false;
pos++; char x = get();
/** * Parses an object for the form <i>{}</i> and <i>{ members }</i>. * * @return DBObject the next object * @throws JSONParseException if invalid JSON is found */ protected Object parseObject(final String name) { if (name != null) { _callback.objectStart(name); } else { _callback.objectStart(); } read('{'); char current = get(); while (get() != '}') { String key = parseString(false); read(':'); Object value = parse(key); doCallback(key, value); if ((current = get()) == ',') { read(','); } else { break; } } read('}'); return _callback.objectDone(); }
/** * Parses the next array. * * @return the array * @throws JSONParseException if invalid JSON is found */ protected Object parseArray(final String name) { if (name != null) { _callback.arrayStart(name); } else { _callback.arrayStart(); } read('['); int i = 0; char current = get(); while (current != ']') { String elemName = String.valueOf(i++); Object elem = parse(elemName); doCallback(elemName, elem); if ((current = get()) == ',') { read(','); } else if (current == ']') { break; } else { throw new JSONParseException(s, pos); } } read(']'); return _callback.arrayDone(); }
char current = get();