|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.json.client.JSONValue
com.google.gwt.json.client.JSONObject
public class JSONObject
Represents a JSON object. A JSON object is a map of string-based keys onto a
set of JSONValue
objects.
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 key. |
JSONValue |
get(java.lang.String key)
Gets the JSONValue associated with the specified key. |
JSONObject |
isObject()
Returns this , as this is a JSONObject. |
java.util.Set |
keySet()
Returns keys for which this JSONObject has associations. |
JSONValue |
put(java.lang.String key,
JSONValue jsonValue)
Maps the specified key to the specified value in this JSONObject. |
int |
size()
Determines the number of keys 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JSONObject()
public JSONObject(JavaScriptObject jsValue)
Method Detail |
---|
public boolean containsKey(java.lang.String key)
key
- the key to search for
true
if the JSONObject contains the specified keypublic JSONValue get(java.lang.String key)
key
- the key to search for
null
otherwisepublic JSONObject isObject()
this
, as this is a JSONObject.
isObject
in class JSONValue
null
otherwise.public java.util.Set keySet()
public JSONValue put(java.lang.String key, JSONValue jsonValue)
key
- the key to associate with the specified valuejsonValue
- the value to associate with this key
null
otherwise
java.lang.NullPointerException
- if key is null
public int size()
public java.lang.String toString()
toString
in class JSONValue
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |