Public 成员函数 | |
| JsonObject () | |
| void | add (String property, JsonElement value) |
| JsonElement | remove (String property) |
| void | addProperty (String property, String value) |
| void | addProperty (String property, Number value) |
| void | addProperty (String property, Boolean value) |
| void | addProperty (String property, Character value) |
| Set< Map.Entry< String, JsonElement > > | entrySet () |
| boolean | has (String memberName) |
| JsonElement | get (String memberName) |
| JsonPrimitive | getAsJsonPrimitive (String memberName) |
| JsonArray | getAsJsonArray (String memberName) |
| JsonObject | getAsJsonObject (String memberName) |
| boolean | equals (Object o) |
| int | hashCode () |
Public 成员函数 继承自 com.google.gson.JsonElement | |
| boolean | isJsonArray () |
| boolean | isJsonObject () |
| boolean | isJsonPrimitive () |
| boolean | isJsonNull () |
| JsonObject | getAsJsonObject () |
| JsonArray | getAsJsonArray () |
| JsonPrimitive | getAsJsonPrimitive () |
| JsonNull | getAsJsonNull () |
| boolean | getAsBoolean () |
| Number | getAsNumber () |
| String | getAsString () |
| double | getAsDouble () |
| float | getAsFloat () |
| long | getAsLong () |
| int | getAsInt () |
| byte | getAsByte () |
| char | getAsCharacter () |
| BigDecimal | getAsBigDecimal () |
| BigInteger | getAsBigInteger () |
| short | getAsShort () |
| String | toString () |
Private 成员函数 | |
| JsonElement | createJsonElement (Object value) |
Private 属性 | |
| final Map< String, JsonElement > | members = new LinkedHashMap<String, JsonElement>() |
额外继承的成员函数 | |
包函数 继承自 com.google.gson.JsonElement | |
| Boolean | getAsBooleanWrapper () |
A class representing an object type in Json. An object consists of name-value pairs where names are strings, and values are any other type of JsonElement. This allows for a creating a tree of JsonElements. The member elements of this object are maintained in order they were added.
|
inline |
Creates an empty JsonObject.
|
inline |
Adds a member, which is a name-value pair, to self. The name must be a String, but the value can be an arbitrary JsonElement, thereby allowing you to build a full tree of JsonElements rooted at this node.
| property | name of the member. |
| value | the member object. |
|
inline |
Convenience method to add a primitive member. The specified value is converted to a JsonPrimitive of String.
| property | name of the member. |
| value | the string value associated with the member. |
|
inline |
Convenience method to add a primitive member. The specified value is converted to a JsonPrimitive of Number.
| property | name of the member. |
| value | the number value associated with the member. |
|
inline |
Convenience method to add a boolean member. The specified value is converted to a JsonPrimitive of Boolean.
| property | name of the member. |
| value | the number value associated with the member. |
|
inline |
Convenience method to add a char member. The specified value is converted to a JsonPrimitive of Character.
| property | name of the member. |
| value | the number value associated with the member. |
|
inlineprivate |
Creates the proper JsonElement object from the given
object.
| value | the object to generate the JsonElement for |
|
inline |
Returns a set of members of this object. The set is ordered, and the order is in which the elements were added.
|
inline |
|
inline |
Returns the member with the specified name.
| memberName | name of the member that is being requested. |
|
inline |
|
inline |
Convenience method to get the specified member as a JsonObject.
| memberName | name of the member being requested. |
|
inline |
Convenience method to get the specified member as a JsonPrimitive element.
| memberName | name of the member being requested. |
|
inline |
Convenience method to check if a member with the specified name is present in this object.
| memberName | name of the member that is being checked for presence. |
|
inline |
|
inline |
Removes the
from this JsonObject.
| property | name of the member that should be removed. |
|
private |
1.8.8