AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
Public 成员函数 | Private 成员函数 | Private 属性 | 所有成员列表
com.google.gson.JsonObject类 参考
类 com.google.gson.JsonObject 继承关系图:
com.google.gson.JsonElement

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, JsonElementmembers = 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.

作者
Inderjeet Singh
Joel Leitch

构造及析构函数说明

com.google.gson.JsonObject.JsonObject ( )
inline

Creates an empty JsonObject.

成员函数说明

void com.google.gson.JsonObject.add ( String  property,
JsonElement  value 
)
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.

参数
propertyname of the member.
valuethe member object.
void com.google.gson.JsonObject.addProperty ( String  property,
String  value 
)
inline

Convenience method to add a primitive member. The specified value is converted to a JsonPrimitive of String.

参数
propertyname of the member.
valuethe string value associated with the member.
void com.google.gson.JsonObject.addProperty ( String  property,
Number  value 
)
inline

Convenience method to add a primitive member. The specified value is converted to a JsonPrimitive of Number.

参数
propertyname of the member.
valuethe number value associated with the member.
void com.google.gson.JsonObject.addProperty ( String  property,
Boolean  value 
)
inline

Convenience method to add a boolean member. The specified value is converted to a JsonPrimitive of Boolean.

参数
propertyname of the member.
valuethe number value associated with the member.
void com.google.gson.JsonObject.addProperty ( String  property,
Character  value 
)
inline

Convenience method to add a char member. The specified value is converted to a JsonPrimitive of Character.

参数
propertyname of the member.
valuethe number value associated with the member.
JsonElement com.google.gson.JsonObject.createJsonElement ( Object  value)
inlineprivate

Creates the proper JsonElement object from the given

value

object.

参数
valuethe object to generate the JsonElement for
返回
a JsonPrimitive if the
value
is not null, otherwise a JsonNull
Set<Map.Entry<String, JsonElement> > com.google.gson.JsonObject.entrySet ( )
inline

Returns a set of members of this object. The set is ordered, and the order is in which the elements were added.

返回
a set of members of this object.
boolean com.google.gson.JsonObject.equals ( Object  o)
inline
JsonElement com.google.gson.JsonObject.get ( String  memberName)
inline

Returns the member with the specified name.

参数
memberNamename of the member that is being requested.
返回
the member matching the name. Null if no such member exists.
JsonArray com.google.gson.JsonObject.getAsJsonArray ( String  memberName)
inline

Convenience method to get the specified member as a JsonArray.

参数
memberNamename of the member being requested.
返回
the JsonArray corresponding to the specified member.
JsonObject com.google.gson.JsonObject.getAsJsonObject ( String  memberName)
inline

Convenience method to get the specified member as a JsonObject.

参数
memberNamename of the member being requested.
返回
the JsonObject corresponding to the specified member.
JsonPrimitive com.google.gson.JsonObject.getAsJsonPrimitive ( String  memberName)
inline

Convenience method to get the specified member as a JsonPrimitive element.

参数
memberNamename of the member being requested.
返回
the JsonPrimitive corresponding to the specified member.
boolean com.google.gson.JsonObject.has ( String  memberName)
inline

Convenience method to check if a member with the specified name is present in this object.

参数
memberNamename of the member that is being checked for presence.
返回
true if there is a member with the specified name, false otherwise.
int com.google.gson.JsonObject.hashCode ( )
inline
JsonElement com.google.gson.JsonObject.remove ( String  property)
inline

Removes the

property

from this JsonObject.

参数
propertyname of the member that should be removed.
返回
the JsonElement object that is being removed.
自从
1.3

类成员变量说明

final Map<String, JsonElement> com.google.gson.JsonObject.members = new LinkedHashMap<String, JsonElement>()
private

该类的文档由以下文件生成: