
public class JreJsonObject extends JreJsonValue implements JsonObject
| Constructor and Description |
|---|
JreJsonObject(JsonFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
asBoolean()
Coerces underlying value to boolean according to the rules of Javascript coercion.
|
double |
asNumber()
Coerces the underlying value to a number according to the rules of Javascript coercion.
|
String |
asString()
Coerces the underlying value to a String according to the rules of JavaScript coercion.
|
JsonValue |
get(String key)
Return the element (uncoerced) as a JsonValue.
|
JsonArray |
getArray(String key)
Return the element (uncoerced) as a JsonArray.
|
boolean |
getBoolean(String key)
Return the element (uncoerced) as a boolean.
|
double |
getNumber(String key)
Return the element (uncoerced) as a number.
|
Object |
getObject() |
JsonObject |
getObject(String key)
Return the element (uncoerced) as a JsonObject If the type is not an object,,
this can result in runtime errors.
|
String |
getString(String key)
Return the element (uncoerced) as a String.
|
JsonType |
getType()
Returns an enumeration representing the fundamental JSON type.
|
boolean |
hasKey(String key)
Test whether a given key has present.
|
boolean |
jsEquals(JsonValue value)
Equivalent of Javascript '==' operator comparison between two values.
|
String[] |
keys()
All keys of the object.
|
void |
put(String key,
boolean bool)
Set a given key to the given boolean value.
|
void |
put(String key,
double value)
Set a given key to the given double value.
|
void |
put(String key,
JsonValue value)
Set a given key to the given value.
|
void |
put(String key,
String value)
Set a given key to the given String value.
|
void |
remove(String key)
Remove a given key and associated value from the object.
|
void |
set(String key,
JsonValue value) |
String |
toJson()
Returns a serialized JSON string representing this value.
|
String |
toString() |
void |
traverse(elemental.json.impl.JsonVisitor visitor,
elemental.json.impl.JsonContext ctx) |
toNativepublic JreJsonObject(JsonFactory factory)
public boolean asBoolean()
JsonValuepublic double asNumber()
JsonValuepublic String asString()
JsonValuepublic JsonValue get(String key)
JsonObjectget in interface JsonObjectpublic JsonArray getArray(String key)
JsonObjectgetArray in interface JsonObjectpublic boolean getBoolean(String key)
JsonObjectgetBoolean in interface JsonObjectpublic double getNumber(String key)
JsonObjectgetNumber in interface JsonObjectpublic JsonObject getObject(String key)
JsonObjectgetObject in interface JsonObjectpublic Object getObject()
getObject in class JreJsonValuepublic String getString(String key)
JsonObjectgetString in interface JsonObjectpublic JsonType getType()
JsonValuepublic boolean hasKey(String key)
JsonObjecthasKey in interface JsonObjectpublic boolean jsEquals(JsonValue value)
JsonValuepublic String[] keys()
JsonObjectkeys in interface JsonObjectpublic void put(String key, JsonValue value)
JsonObjectput in interface JsonObjectpublic void put(String key, String value)
JsonObjectput in interface JsonObjectpublic void put(String key, double value)
JsonObjectput in interface JsonObjectpublic void put(String key, boolean bool)
JsonObjectput in interface JsonObjectpublic void remove(String key)
JsonObjectremove in interface JsonObjectpublic String toJson()
JsonValuepublic void traverse(elemental.json.impl.JsonVisitor visitor,
elemental.json.impl.JsonContext ctx)
traverse in class JreJsonValueCopyright © 2016. All rights reserved.