@Deprecated public class UnmodifiableJSONObject extends AbstractUnmodifiableJSONObject
| Modifier and Type | Method and Description |
|---|---|
<A extends JSONArray,O extends JSONObject> |
clone(JSONBuilder<A,O> builder)
Deprecated.
|
static UnmodifiableJSONObject |
emptyInstance()
Deprecated.
|
boolean |
equals(java.lang.Object obj)
Deprecated.
|
boolean |
equalsMap(java.util.Map<java.lang.String,java.lang.Object> map)
Deprecated.
|
java.lang.Object |
get(java.lang.String key)
Deprecated.
Get the value object associated with a key.
|
boolean |
getBoolean(java.lang.String key)
Deprecated.
Get the boolean value associated with a key.
|
double |
getDouble(java.lang.String key)
Deprecated.
Get the double value associated with a key.
|
java.lang.Double |
getDoubleObj(java.lang.String key)
Deprecated.
Get the compulsory number as a Double Object throwing a JSONException if this is not possible.
|
static UnmodifiableJSONObject |
getInstance(JSONObject jObj)
Deprecated.
|
static UnmodifiableJSONObject |
getInstance(java.lang.String source)
Deprecated.
|
int |
getInt(java.lang.String key)
Deprecated.
Get the int value associated with a key.
|
UnmodifiableJSONArray |
getJSONArray(java.lang.String key)
Deprecated.
Get the JSONArray value associated with a key.
|
UnmodifiableJSONObject |
getJSONObject(java.lang.String key)
Deprecated.
Get the JSONObject value associated with a key.
|
long |
getLong(java.lang.String key)
Deprecated.
Get the long value associated with a key.
|
java.lang.String |
getString(java.lang.String key)
Deprecated.
Get the string associated with a key.
|
boolean |
has(java.lang.String key)
Deprecated.
Determine if the JSONObject contains a specific key.
|
int |
hashCode()
Deprecated.
|
boolean |
isNull(java.lang.String key)
Deprecated.
Determine if the value associated with the key is null or if there is no value.
|
java.util.Iterator<java.lang.String> |
keys()
Deprecated.
Get an enumeration of the keys of the JSONObject.
|
int |
length()
Deprecated.
Get the number of keys stored in the JSONObject.
|
java.lang.Object |
opt(java.lang.String key)
Deprecated.
Get an optional value associated with a key.
|
boolean |
optBoolean(java.lang.String key)
Deprecated.
Get an optional boolean associated with a key.
|
boolean |
optBoolean(java.lang.String key,
boolean defaultValue)
Deprecated.
Get an optional boolean associated with a key.
|
double |
optDouble(java.lang.String key)
Deprecated.
Get an optional double associated with a key, or NaN if there is no such key or if its value is
not a number.
|
double |
optDouble(java.lang.String key,
double defaultValue)
Deprecated.
Get an optional double associated with a key, or the defaultValue if there is no such key or if
its value is not a number.
|
java.lang.Double |
optDoubleObj(java.lang.String key,
java.lang.Double defaultValue)
Deprecated.
Get the optional number as a Double Object returning the optional defaultValue if this is not
possible.
|
int |
optInt(java.lang.String key)
Deprecated.
Get an optional int value associated with a key, or zero if there is no such key or if the
value is not a number.
|
int |
optInt(java.lang.String key,
int defaultValue)
Deprecated.
Get an optional int value associated with a key, or the default if there is no such key or if
the value is not a number.
|
java.lang.Integer |
optInteger(java.lang.String key)
Deprecated.
Get an optional Integer value associated with the key, or null if there is no such key or if
the value is not a number and the string representation cannot be parsed as an Integer.
|
java.lang.Integer |
optInteger(java.lang.String key,
java.lang.Integer defaultValue)
Deprecated.
Get an optional Integer value associated with the key, or the specified defaultValue if there
is no such key or if the value is not a number and the string representation cannot be parsed
as an Integer.
|
UnmodifiableJSONArray |
optJSONArray(java.lang.String key)
Deprecated.
Get an optional JSONArray associated with a key.
|
UnmodifiableJSONObject |
optJSONObject(java.lang.String key)
Deprecated.
Get an optional JSONObject associated with a key.
|
long |
optLong(java.lang.String key)
Deprecated.
Get an optional long value associated with a key, or zero if there is no such key or if the
value is not a number.
|
long |
optLong(java.lang.String key,
long defaultValue)
Deprecated.
Get an optional long value associated with a key, or the default if there is no such key or if
the value is not a number.
|
java.lang.String |
optString(java.lang.String key)
Deprecated.
Get an optional string associated with a key.
|
java.lang.String |
optString(java.lang.String key,
java.lang.String defaultValue)
Deprecated.
Get an optional string associated with a key.
|
java.util.Iterator<java.lang.String> |
sortedKeys()
Deprecated.
Get an enumeration of the keys of the JSONObject.
|
java.lang.String |
toString()
Deprecated.
Make a JSON text of this JSONObject.
|
java.lang.String |
toString(int indentFactor)
Deprecated.
Make a prettyprinted JSON text of this JSONObject.
|
java.lang.String |
toString(int indentFactor,
int indent)
Deprecated.
Make a prettyprinted JSON text of this JSONObject.
|
java.lang.Appendable |
write(java.lang.Appendable writer)
Deprecated.
Write the contents of the JSONComponent as JSON text to a writer.
|
public static final UnmodifiableJSONObject emptyInstance()
public static UnmodifiableJSONObject getInstance(JSONObject jObj)
public static UnmodifiableJSONObject getInstance(java.lang.String source) throws JSONException
JSONExceptionpublic java.lang.Object get(java.lang.String key)
throws JSONException
JSONObjectkey - A key string.JSONException - if the key is not found.public boolean getBoolean(java.lang.String key)
throws JSONException
JSONObjectkey - A key string.JSONException - if the value is not a Boolean or the String "true" or "false".public double getDouble(java.lang.String key)
throws JSONException
JSONObjectkey - A key string.JSONException - if the key is not found or if the value is not a Number object and cannot be
converted to a number.public int getInt(java.lang.String key)
throws JSONException
JSONObjectkey - A key string.JSONException - if the key is not found or if the value cannot be converted to an integer.public UnmodifiableJSONArray getJSONArray(java.lang.String key) throws JSONException
JSONObjectkey - A key string.JSONException - if the key is not found or if the value is not a JSONArray.public UnmodifiableJSONObject getJSONObject(java.lang.String key) throws JSONException
JSONObjectkey - A key string.JSONException - if the key is not found or if the value is not a JSONObject.public long getLong(java.lang.String key)
throws JSONException
JSONObjectkey - A key string.JSONException - if the key is not found or if the value cannot be converted to a long.public java.lang.String getString(java.lang.String key)
throws JSONException
JSONObjectkey - A key string.JSONException - if the key is not found.public boolean has(java.lang.String key)
JSONObjectkey - A key string.public boolean isNull(java.lang.String key)
JSONObjectkey - A key string.public java.util.Iterator<java.lang.String> keys()
JSONObjectpublic int length()
JSONObjectpublic java.lang.Object opt(java.lang.String key)
JSONObjectkey - A key string.public boolean optBoolean(java.lang.String key)
JSONObjectkey - A key string.public boolean optBoolean(java.lang.String key,
boolean defaultValue)
JSONObjectkey - A key string.defaultValue - The default.public double optDouble(java.lang.String key)
JSONObjectkey - A string which is the key.public double optDouble(java.lang.String key,
double defaultValue)
JSONObjectkey - A key string.defaultValue - The default.public int optInt(java.lang.String key)
JSONObjectkey - A key string.public int optInt(java.lang.String key,
int defaultValue)
JSONObjectkey - A key string.defaultValue - The default.public UnmodifiableJSONArray optJSONArray(java.lang.String key)
JSONObjectkey - A key string.public UnmodifiableJSONObject optJSONObject(java.lang.String key)
JSONObjectkey - A key string.public long optLong(java.lang.String key)
JSONObjectkey - A key string.public long optLong(java.lang.String key,
long defaultValue)
JSONObjectkey - A key string.defaultValue - The default.public java.lang.String optString(java.lang.String key)
JSONObjectkey - A key string.public java.lang.String optString(java.lang.String key,
java.lang.String defaultValue)
JSONObjectkey - A key string.defaultValue - The default.public java.util.Iterator<java.lang.String> sortedKeys()
JSONObjectpublic java.lang.String toString(int indentFactor)
JSONComponentWarning: This method assumes that the data structure is acyclical.
indentFactor - The number of spaces to add to each level of indentation.{ (left brace) and ending with
} (right brace).public java.lang.Appendable write(java.lang.Appendable writer)
throws java.io.IOException
JSONComponentWarning: This method assumes that the data structure is acyclical.
java.io.IOExceptionpublic java.lang.String toString()
JSONComponentWarning: This method assumes that the data structure is acyclical.
toString in interface JSONComponenttoString in class java.lang.Object{ (left brace) and ending with
} (right brace).public boolean equalsMap(java.util.Map<java.lang.String,java.lang.Object> map)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Integer optInteger(java.lang.String key)
JSONObjectpublic java.lang.Integer optInteger(java.lang.String key,
java.lang.Integer defaultValue)
JSONObjectpublic java.lang.String toString(int indentFactor,
int indent)
JSONComponentWarning: This method assumes that the data structure is acyclical.
indentFactor - The number of spaces to add to each level of indentation.indent - The indentation of the top level.{ (left brace) and ending with }
(right brace).public java.lang.Double getDoubleObj(java.lang.String key)
throws JSONException
JSONObjectJSONExceptionpublic java.lang.Double optDoubleObj(java.lang.String key,
java.lang.Double defaultValue)
JSONObjectpublic <A extends JSONArray,O extends JSONObject> O clone(JSONBuilder<A,O> builder) throws JSONException
JSONException