/** * @webref input:files * @param input String to parse as a JSONObject * @see PApplet#loadJSONObject(String) * @see PApplet#saveJSONObject(JSONObject, String) */ public JSONObject parseJSONObject(String input) { return new JSONObject(new StringReader(input)); }
/** * @webref input:files * @param input String to parse as a JSONObject * @see PApplet#loadJSONObject(String) * @see PApplet#saveJSONObject(JSONObject, String) */ public JSONObject parseJSONObject(String input) { return new JSONObject(new StringReader(input)); }
static public JSONObject loadJSONObject(File file) { return new JSONObject(createReader(file)); }
/** * @nowebref */ static public JSONObject loadJSONObject(File file) { return new JSONObject(createReader(file)); }
/** * @webref input:files * @param filename name of a file in the data folder or a URL * @see JSONObject * @see JSONArray * @see PApplet#loadJSONArray(String) * @see PApplet#saveJSONObject(JSONObject, String) * @see PApplet#saveJSONArray(JSONArray, String) */ public JSONObject loadJSONObject(String filename) { return new JSONObject(createReader(filename)); }
/** * @webref input:files * @param filename name of a file in the data folder or a URL * @see JSONObject * @see JSONArray * @see PApplet#loadJSONArray(String) * @see PApplet#saveJSONObject(JSONObject, String) * @see PApplet#saveJSONArray(JSONArray, String) */ public JSONObject loadJSONObject(String filename) { return new JSONObject(createReader(filename)); }
/** * Construct a JSONObject from a source JSON text string. * This is the most commonly used JSONObject constructor. * @param source A string beginning * with <code>{</code> <small>(left brace)</small> and ending * with <code>}</code> <small>(right brace)</small>. * @exception JSONException If there is a syntax error in the source * string or a duplicated key. */ static public JSONObject parse(String source) { return new JSONObject(new JSONTokener(source)); }
/** * Construct a JSONObject from a source JSON text string. * This is the most commonly used JSONObject constructor. * @param source A string beginning * with <code>{</code> <small>(left brace)</small> and ending * with <code>}</code> <small>(right brace)</small>. * @exception RuntimeException If there is a syntax error in the source * string or a duplicated key. */ static public JSONObject parse(String source) { return new JSONObject(new JSONTokener(source)); }
return new JSONObject(object); return object.toString(); return new JSONObject(object); } catch(Exception exception) { return null;
return new JSONObject((Map)object); return object.toString(); return new JSONObject(object); } catch(Exception exception) { return null;
((JSONArray) value).writeInternal(writer, indentFactor, indent); } else if (value instanceof Map) { new JSONObject(value).writeInternal(writer, indentFactor, indent); } else if (value instanceof Collection) { new JSONArray(value).writeInternal(writer, indentFactor,
((JSONArray) value).write(writer, indentFactor, indent); } else if (value instanceof Map) { new JSONObject((Map) value).write(writer, indentFactor, indent); } else if (value instanceof Collection) { new JSONArray((Collection) value).write(writer, indentFactor,
case '{': this.back(); return new JSONObject(this); case '[': this.back();
case '{': this.back(); return new JSONObject(this); case '[': this.back();
return new JSONObject(value).toString();
return new JSONObject((Map)value).toString();