Uses of Class
org.json.JSONException

  • Uses of JSONException in org.json

    Methods in org.json that return JSONException
    Modifier and Type
    Method
    Description
    JSONTokener.syntaxError(String message)
    Returns an exception containing the given message plus the current position and the entire input string.
    Methods in org.json that throw JSONException
    Modifier and Type
    Method
    Description
    JSONObject.accumulate(String name, Object value)
    Appends value to the array already mapped to name.
    JSONStringer.array()
    Begins encoding a new array.
    JSONStringer.endArray()
    Ends encoding the current array.
    JSONStringer.endObject()
    Ends encoding the current object.
    JSONArray.get(int index)
    Returns the value at index.
    JSONObject.get(String name)
    Returns the value mapped by name.
    boolean
    JSONArray.getBoolean(int index)
    Returns the value at index if it exists and is a boolean or can be coerced to a boolean.
    boolean
    JSONObject.getBoolean(String name)
    Returns the value mapped by name if it exists and is a boolean or can be coerced to a boolean.
    double
    JSONArray.getDouble(int index)
    Returns the value at index if it exists and is a double or can be coerced to a double.
    double
    JSONObject.getDouble(String name)
    Returns the value mapped by name if it exists and is a double or can be coerced to a double.
    int
    JSONArray.getInt(int index)
    Returns the value at index if it exists and is an int or can be coerced to an int.
    int
    JSONObject.getInt(String name)
    Returns the value mapped by name if it exists and is an int or can be coerced to an int.
    JSONArray.getJSONArray(int index)
    Returns the value at index if it exists and is a JSONArray.
    JSONObject.getJSONArray(String name)
    Returns the value mapped by name if it exists and is a JSONArray.
    JSONArray.getJSONObject(int index)
    Returns the value at index if it exists and is a JSONObject.
    JSONObject.getJSONObject(String name)
    Returns the value mapped by name if it exists and is a JSONObject.
    long
    JSONArray.getLong(int index)
    Returns the value at index if it exists and is a long or can be coerced to a long.
    long
    JSONObject.getLong(String name)
    Returns the value mapped by name if it exists and is a long or can be coerced to a long.
    JSONArray.getString(int index)
    Returns the value at index if it exists, coercing it if necessary.
    JSONObject.getString(String name)
    Returns the value mapped by name if it exists, coercing it if necessary.
    JSONArray.join(String separator)
    Returns a new string by alternating this array's values with separator.
    JSONStringer.key(String name)
    Encodes the key (property name) to this stringer.
    char
    JSONTokener.next(char c)
    Returns the next available character if it equals c.
    JSONTokener.next(int length)
    Returns the next length characters of the input.
    char
    JSONTokener.nextClean()
    Returns the next character that is not whitespace and does not belong to a comment.
    JSONTokener.nextString(char quote)
    Returns the string up to but not including quote, unescaping any character escape sequences encountered along the way.
    JSONTokener.nextValue()
    Returns the next value from the input.
    static String
    JSONObject.numberToString(Number number)
    Encodes the number as a JSON string.
    JSONStringer.object()
    Begins encoding a new object.
    JSONArray.put(double value)
    Appends value to the end of this array.
    JSONArray.put(int index, boolean value)
    Sets the value at index to value, null padding this array to the required length if necessary.
    JSONArray.put(int index, double value)
    Sets the value at index to value, null padding this array to the required length if necessary.
    JSONArray.put(int index, int value)
    Sets the value at index to value, null padding this array to the required length if necessary.
    JSONArray.put(int index, long value)
    Sets the value at index to value, null padding this array to the required length if necessary.
    JSONArray.put(int index, Object value)
    Sets the value at index to value, null padding this array to the required length if necessary.
    JSONObject.put(String name, boolean value)
    Maps name to value, clobbering any existing name/value mapping with the same name.
    JSONObject.put(String name, double value)
    Maps name to value, clobbering any existing name/value mapping with the same name.
    JSONObject.put(String name, int value)
    Maps name to value, clobbering any existing name/value mapping with the same name.
    JSONObject.put(String name, long value)
    Maps name to value, clobbering any existing name/value mapping with the same name.
    JSONObject.put(String name, Object value)
    Maps name to value, clobbering any existing name/value mapping with the same name.
    JSONObject.putOpt(String name, Object value)
    Equivalent to put(name, value) when both parameters are non-null; does nothing otherwise.
    JSONObject.toJSONArray(JSONArray names)
    Returns an array with the values corresponding to names.
    JSONArray.toJSONObject(JSONArray names)
    Returns a new object whose values are the values in this array, and whose names are the values in names.
    JSONArray.toString(int indentSpaces)
    Encodes this array as a human readable JSON string for debugging, such as:
    JSONObject.toString(int indentSpaces)
    Encodes this object as a human readable JSON string for debugging, such as:
    JSONStringer.value(boolean value)
    Encodes value to this stringer.
    JSONStringer.value(double value)
    Encodes value to this stringer.
    JSONStringer.value(long value)
    Encodes value to this stringer.
    JSONStringer.value(Object value)
    Encodes value.
    Constructors in org.json that throw JSONException
    Modifier
    Constructor
    Description
     
    Creates a new JSONArray with values from the JSON string.
     
    Creates a new JSONArray with values from the next array in the tokener.
     
    Creates a new JSONObject with name/value mappings from the JSON string.
     
    JSONObject(JSONObject copyFrom, String[] names)
    Creates a new JSONObject by copying mappings for the listed names from the given object.
     
    Creates a new JSONObject with name/value mappings from the next object in the tokener.