/** * Read the current character, making sure that it is a hexidecimal character. * * @throws JSONParseException if the current character is not a hexidecimal character */ public void readHex() { if (pos < s.length() && ((s.charAt(pos) >= '0' && s.charAt(pos) <= '9') || (s.charAt(pos) >= 'A' && s.charAt(pos) <= 'F') || (s.charAt(pos) >= 'a' && s.charAt(pos) <= 'f'))) { pos++; } else { throw new JSONParseException(s, pos); } }
/** * Read the current character, making sure that it is the expected character. Advances the pointer to the next character. * * @param ch the character expected * @throws JSONParseException if the current character does not match the given character */ public void read(final char ch) { if (!check(ch)) { throw new JSONParseException(s, pos); } pos++; }
throw new JSONParseException(s, start, e);
quot = '\"'; } else if (needQuote) { throw new JSONParseException(s, pos);
/** * 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(); }
break; default: throw new JSONParseException(s, pos);
/** * Read the current character, making sure that it is a hexidecimal character. * * @throws JSONParseException if the current character is not a hexidecimal character */ public void readHex() { if (pos < s.length() && ((s.charAt(pos) >= '0' && s.charAt(pos) <= '9') || (s.charAt(pos) >= 'A' && s.charAt(pos) <= 'F') || (s.charAt(pos) >= 'a' && s.charAt(pos) <= 'f'))) { pos++; } else { throw new JSONParseException(s, pos); } }
/** * Read the current character, making sure that it is the expected character. Advances the pointer to the next character. * * @param ch the character expected * @throws JSONParseException if the current character does not match the given character */ public void read(final char ch) { if (!check(ch)) { throw new JSONParseException(s, pos); } pos++; }
/** * Read the current character, making sure that it is a hexidecimal character. * * @throws JSONParseException if the current character is not a hexidecimal character */ public void readHex() { if (pos < s.length() && ((s.charAt(pos) >= '0' && s.charAt(pos) <= '9') || (s.charAt(pos) >= 'A' && s.charAt(pos) <= 'F') || (s.charAt(pos) >= 'a' && s.charAt(pos) <= 'f'))) { pos++; } else { throw new JSONParseException(s, pos); } }
/** * Read the current character, making sure that it is the expected character. * Advances the pointer to the next character. * * @param ch the character expected * * @throws JSONParseException if the current character does not match the given character */ public void read(char ch) { if(!check(ch)) { throw new JSONParseException(s, pos); } pos++; }
return val; }catch(NumberFormatException e){ throw new JSONParseException(s, start, e);
throw new JSONParseException(s, start, e);
quot = '\"'; else if (needQuote) throw new JSONParseException(s, pos);
quot = '\"'; } else if (needQuote) { throw new JSONParseException(s, pos);
/** * 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(); }
throw new JSONParseException(s, pos);
break; default: throw new JSONParseException(s, pos);
break; default: throw new JSONParseException(s, pos);