xlang v5.1 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
JsonObject.x
浏览该文件的文档.
1
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 // 构造函数 - 带字符串参数
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)
80 // 通过键名获取值
81 public @NotNilptr Object [](Object);
82};
String getString(Object)
Object(Object)
JsonObject getObject(Object)
long getLong()
bool isNull(Object)
static const int JSONTYPE_NUMBER
Definition JsonObject.x:10
String toString(bool)
void finalize()
int getInt(Object)
bool getBool(Object)
final int getType()
static const int JSONTYPE_STRING
Definition JsonObject.x:11
JsonNode next()
bool equals(JsonNode)
bool has(Object)
int getInt()
double getDouble()
String getName()
bool isArray()
XmlObject asXml(String)
JsonArray getArray(Object)
double getDouble(Object)
static const int JSONTYPE_ARRAY
Definition JsonObject.x:12
static const int JSONTYPE_BOOL
Definition JsonObject.x:8
static const int JSONTYPE_OBJECT
Definition JsonObject.x:13
JsonNode prev()
static const int JSONTYPE_NULL
Definition JsonObject.x:9
long getLong(Object)
Object(Object, Object)
String toString()
String getString()
JsonNode clone()
JsonObject(String)
bool getBool()
void put(Object, Object)
JsonNode child()
Definition Object.x:1
Definition String.x:5