|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.json.client.JSONValue com.google.gwt.json.client.JSONObject
public class JSONObject
Represents a JSON object. A JSON object consists of a set of properties.
Constructor Summary | |
---|---|
JSONObject()
|
|
JSONObject(JavaScriptObject jsValue)
Creates a new JSONObject from the supplied JavaScript value. |
Method Summary | |
---|---|
boolean |
containsKey(java.lang.String key)
Tests whether or not this JSONObject contains the specified property. |
boolean |
equals(java.lang.Object other)
Returns true if other is a JSONObject
wrapping the same underlying object. |
JSONValue |
get(java.lang.String key)
Gets the JSONValue associated with the specified property. |
JavaScriptObject |
getJavaScriptObject()
Returns the underlying JavaScript object that this object wraps. |
(package private) JavaScriptObject |
getUnwrapper()
Internal. |
int |
hashCode()
|
JSONObject |
isObject()
Returns this , as this is a JSONObject. |
java.util.Set<java.lang.String> |
keySet()
Returns the set of properties defined on this JSONObject. |
JSONValue |
put(java.lang.String key,
JSONValue jsonValue)
Assign the specified property to the specified value in this JSONObject. |
int |
size()
Determines the number of properties on this object. |
java.lang.String |
toString()
Converts a JSONObject into a JSON representation that can be used to communicate with a JSON service. |
Methods inherited from class com.google.gwt.json.client.JSONValue |
---|
isArray, isBoolean, isNull, isNumber, isString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JSONObject()
public JSONObject(JavaScriptObject jsValue)
Method Detail |
---|
public boolean containsKey(java.lang.String key)
key
- the property to search for
true
if the JSONObject contains the specified propertypublic boolean equals(java.lang.Object other)
true
if other
is a JSONObject
wrapping the same underlying object.
equals
in class java.lang.Object
public JSONValue get(java.lang.String key)
key
- the property to access
null
if the
property does not exist
java.lang.NullPointerException
- if key is null
public JavaScriptObject getJavaScriptObject()
public int hashCode()
hashCode
in class java.lang.Object
public JSONObject isObject()
this
, as this is a JSONObject.
isObject
in class JSONValue
null
otherwise.public java.util.Set<java.lang.String> keySet()
public JSONValue put(java.lang.String key, JSONValue jsonValue)
key
- the property to assignjsonValue
- the value to assign
null
if the
property did not exist
java.lang.NullPointerException
- if key is null
public int size()
public java.lang.String toString()
toString
in class JSONValue
JavaScriptObject getUnwrapper()
JSONValue
getUnwrapper
in class JSONValue
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |