xlang
v5.1 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
JsonObject.x
浏览该文件的文档.
1
5
class
JsonObject
:
JsonNode
{
6
7
// JSON数据类型的常量定义
8
public
static
const
int
JSONTYPE_BOOL
;
// 布尔类型
9
public
static
const
int
JSONTYPE_NULL
;
// 空值类型
10
public
static
const
int
JSONTYPE_NUMBER
;
// 数字类型
11
public
static
const
int
JSONTYPE_STRING
;
// 字符串类型
12
public
static
const
int
JSONTYPE_ARRAY
;
// 数组类型
13
public
static
const
int
JSONTYPE_OBJECT
;
// 对象类型
14
// 判断是否为数组
15
public
bool
isArray
();
16
// 获取节点的下一个节点
17
public
@NotNilptr
JsonNode
next
();
18
// 获取节点的前一个节点
19
public
@NotNilptr
JsonNode
prev
();
20
// 获取节点的子节点
21
public
@NotNilptr
JsonNode
child
();
22
// 获取节点的名称
23
public
@NotNilptr
String
getName
();
24
// 克隆节点
25
public
@NotNilptr
JsonNode
clone
();
26
// 获取节点的类型
27
public
final
int
getType
();
28
// 判断两个节点是否相等
29
public
bool
equals
(
JsonNode
);
30
// 将节点转换为字符串形式
31
public
@NotNilptr
String
toString
(
bool
);
32
// 将节点转换为字符串形式(重载方法)
33
public
@NotNilptr
String
toString
();
34
// 析构函数
35
public
void
finalize
();
36
// 将JSON对象转换为XML对象
37
public
@NotNilptr
XmlObject
asXml
(
String
);
38
// 构造函数 - 无参构造
39
public
JsonObject
();
40
// 构造函数 - 带字符串参数
41
public
JsonObject
(
String
)
42
throws
IllegalArgumentException
;
43
// 通过键名获取整数值
44
public
int
getInt
(
Object
);
45
// 通过键名获取长整数值
46
public
long
getLong
(
Object
);
47
// 通过键名获取双精度浮点数值
48
public
double
getDouble
(
Object
);
49
// 通过键名获取布尔值
50
public
bool
getBool
(
Object
);
51
// 通过键名获取字符串值
52
public
@NotNilptr
String
getString
(
Object
);
53
// 获取整数值(无键名)
54
public
int
getInt
();
55
// 获取长整数值(无键名)
56
public
long
getLong
();
57
// 获取双精度浮点数值(无键名)
58
public
double
getDouble
();
59
// 获取布尔值(无键名)
60
public
bool
getBool
();
61
// 获取字符串值(无键名)
62
public
@NotNilptr
String
getString
();
63
// 通过键名获取JSON数组
64
public
@NotNilptr
JsonArray
getArray
(
Object
);
65
// 通过键名获取JSON对象
66
public
@NotNilptr
JsonObject
getObject
(
Object
);
67
// 通过键名获取JSON节点
68
public
@NotNilptr
JsonNode
get
(
Object
);
69
// 判断指定键名对应的值是否为null
70
public
bool
isNull
(
Object
);
71
// 判断是否包含指定键名
72
public
bool
has
(
Object
);
73
// 移除指定键名对应的值
74
public
bool
remove
(
Object
);
75
// 向JSON对象中添加键值对
76
public
void
put
(
Object
,
Object
);
77
// 通过键名获取值(带默认值)
78
public
@NotNilptr
Object
[](
Object
,
Object
)
79
throws
IllegalArgumentException
;
80
// 通过键名获取值
81
public
@NotNilptr
Object
[](
Object
);
82
};
IllegalArgumentException
Definition
IllegalArgumentException.x:5
JsonArray
Definition
JsonArray.x:5
JsonNode
Definition
JsonNode.x:5
JsonObject
Definition
JsonObject.x:5
JsonObject.getString
String getString(Object)
JsonObject.Object
Object(Object)
JsonObject.getObject
JsonObject getObject(Object)
JsonObject.getLong
long getLong()
JsonObject.isNull
bool isNull(Object)
JsonObject.JSONTYPE_NUMBER
static const int JSONTYPE_NUMBER
Definition
JsonObject.x:10
JsonObject.toString
String toString(bool)
JsonObject.finalize
void finalize()
JsonObject.getInt
int getInt(Object)
JsonObject.getBool
bool getBool(Object)
JsonObject.getType
final int getType()
JsonObject.JSONTYPE_STRING
static const int JSONTYPE_STRING
Definition
JsonObject.x:11
JsonObject.next
JsonNode next()
JsonObject.equals
bool equals(JsonNode)
JsonObject.has
bool has(Object)
JsonObject.getInt
int getInt()
JsonObject.getDouble
double getDouble()
JsonObject.getName
String getName()
JsonObject.isArray
bool isArray()
JsonObject.asXml
XmlObject asXml(String)
JsonObject.getArray
JsonArray getArray(Object)
JsonObject.getDouble
double getDouble(Object)
JsonObject.JSONTYPE_ARRAY
static const int JSONTYPE_ARRAY
Definition
JsonObject.x:12
JsonObject.JSONTYPE_BOOL
static const int JSONTYPE_BOOL
Definition
JsonObject.x:8
JsonObject.JSONTYPE_OBJECT
static const int JSONTYPE_OBJECT
Definition
JsonObject.x:13
JsonObject.prev
JsonNode prev()
JsonObject.JSONTYPE_NULL
static const int JSONTYPE_NULL
Definition
JsonObject.x:9
JsonObject.getLong
long getLong(Object)
JsonObject.Object
Object(Object, Object)
JsonObject.toString
String toString()
JsonObject.getString
String getString()
JsonObject.clone
JsonNode clone()
JsonObject.JsonObject
JsonObject()
JsonObject.JsonObject
JsonObject(String)
JsonObject.getBool
bool getBool()
JsonObject.put
void put(Object, Object)
JsonObject.child
JsonNode child()
Object
Definition
Object.x:1
String
Definition
String.x:5
XmlObject
Definition
XmlObject.x:5
std
JsonObject.x
制作者
1.9.8