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(); }
/** * fill <code>has_liked</code> from summary, in case of open graph object use user_likes instead */ private void fillHasLiked(JsonObject summary) { if (summary != null && summary.get("has_liked") != null) { hasLiked = summary.get("has_liked").asBoolean(); } if (hasLiked == null && openGraphUserLikes != null) { hasLiked = openGraphUserLikes; } }
/** * Put a value in the JsonArray, where the value will be a JsonObject which is * produced from a Map. * * @param value A Map value. * @return this. */ public JsonArray put(Map<?, ?> value) { put(new JsonObject(value)); return this; }
private void readString() throws IOException { handler.startString(); handler.endString(readStringInternal()); }
/** * Put a key/value pair in the JsonObject, where the value will be a JsonArray * which is produced from a Collection. * * @param key A key string. * @param value A Collection value. * @return this. * @throws com.restfb.json.JsonException */ public JsonObject put(String key, Collection<?> value) throws JsonException { put(key, new JsonArray(value)); return this; }
/** * Make a JsonException to signal a syntax error. * * @param message The error message. * @return A JsonException object, suitable for throwing */ public JsonException syntaxError(String message) { return new JsonException(message + toString()); }
/** * Append an object value. * * @param o The object to append. It can be null, or a Boolean, Number, * String, JsonObject, or JsonArray, or an object with a * toJSONString() method. * @return this * @throws com.restfb.json.JsonException If the value is out of sequence. */ public JsonWriter value(Object o) throws JsonException { return this.append(JsonObject.valueToString(o)); } }
private void readTrue() throws IOException { handler.startBoolean(); read(); readRequiredChar('r'); readRequiredChar('u'); readRequiredChar('e'); handler.endBoolean(true); }