JSONObject

Class of org.json · JSONObject.java · Android's reference

public class JSONObject

A JSON object: names in the order they were put, as Android's keeps them.

Fields

public static final Object NULL source

JSON's null, apart from a missing value

Constructors

public JSONObject() source
public JSONObject(Map copyFrom) source
public JSONObject(JSONTokener readFrom) throws JSONException source
public JSONObject(String json) throws JSONException source
public JSONObject(JSONObject copyFrom, String[] names) throws JSONException source

Methods

public int length() source
public JSONObject put(String name, boolean value) throws JSONException source
public JSONObject put(String name, double value) throws JSONException source
public JSONObject put(String name, int value) throws JSONException source
public JSONObject put(String name, long value) throws JSONException source
public JSONObject put(String name, Object value) throws JSONException source
public JSONObject putOpt(String name, Object value) throws JSONException source
public JSONObject accumulate(String name, Object value) throws JSONException source
public JSONObject append(String name, Object value) throws JSONException source
public Object remove(String name) source
public boolean isNull(String name) source
public boolean has(String name) source
public Object get(String name) throws JSONException source
public Object opt(String name) source
public boolean getBoolean(String name) throws JSONException source
public boolean optBoolean(String name) source
public boolean optBoolean(String name, boolean fallback) source
public double getDouble(String name) throws JSONException source
public double optDouble(String name) source
public double optDouble(String name, double fallback) source
public int getInt(String name) throws JSONException source
public int optInt(String name) source
public int optInt(String name, int fallback) source
public long getLong(String name) throws JSONException source
public long optLong(String name) source
public long optLong(String name, long fallback) source
public String getString(String name) throws JSONException source
public String optString(String name) source
public String optString(String name, String fallback) source
public JSONArray getJSONArray(String name) throws JSONException source
public JSONArray optJSONArray(String name) source
public JSONObject getJSONObject(String name) throws JSONException source
public JSONObject optJSONObject(String name) source
public JSONArray toJSONArray(JSONArray names) throws JSONException source
public Iterator<String> keys() source
public Set<String> keySet() source
public JSONArray names() source
public String toString() source
public String toString(int indentSpaces) throws JSONException source
public static String numberToString(Number number) throws JSONException source
public static String quote(String data) source
public static Object wrap(Object o) source

A Java value as a JSON one: collections and maps become arrays and objects


Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.