| java.lang.Object com.google.gwt.json.client.JSONValue com.google.gwt.json.client.JSONObject
Method Summary | |
public boolean | containsKey(String key) Tests whether or not this JSONObject contains the specified key. | public JSONValue | get(String key) Gets the JSONValue associated with the specified key. | public JSONObject | isObject() Returns this , as this is a JSONObject. | public Set<String> | keySet() Returns keys for which this JSONObject has associations. | public JSONValue | put(String key, JSONValue jsonValue) Maps the specified key to the specified value in this JSONObject. | public int | size() Determines the number of keys on this object. | native public String | toString() Converts a JSONObject into a JSON representation that can be used to
communicate with a JSON service. |
JSONObject | public JSONObject()(Code) | | |
JSONObject | public JSONObject(JavaScriptObject jsValue)(Code) | | Creates a new JSONObject from the supplied JavaScript value.
|
containsKey | public boolean containsKey(String key)(Code) | | Tests whether or not this JSONObject contains the specified key.
We use Object.hasOwnProperty here to verify that a given key is specified
on this object rather than a superclass (such as standard properties
defined on Object).
Parameters: key - the key to search for true if the JSONObject contains the specified key |
get | public JSONValue get(String key)(Code) | | Gets the JSONValue associated with the specified key.
We use Object.hasOwnProperty here to verify that a given key is specified
on this object rather than a superclass (such as standard properties
defined on Object).
Parameters: key - the key to search for if found, the value associated with the specified key, ornull otherwise |
isObject | public JSONObject isObject()(Code) | | Returns this , as this is a JSONObject.
|
keySet | public Set<String> keySet()(Code) | | Returns keys for which this JSONObject has associations.
array of keys for which there is a value |
put | public JSONValue put(String key, JSONValue jsonValue)(Code) | | Maps the specified key to the specified value in this JSONObject. If the
specified key already has an associated value, it is overwritten.
Parameters: key - the key to associate with the specified value Parameters: jsonValue - the value to associate with this key if one existed, the previous value associated with the key, ornull otherwise throws: NullPointerException - if key is null |
size | public int size()(Code) | | Determines the number of keys on this object.
|
toString | native public String toString()(Code) | | Converts a JSONObject into a JSON representation that can be used to
communicate with a JSON service.
a JSON string representation of this JSONObject instance |
|
|