File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ jsoniter(json-iterator)是一款快且灵活的 JSON 解析器,同时提
10
10
* Jsoniter 是最快的 JSON 解析器。它最多能比普通的解析器快10倍之多,即使在数据绑定的用法下也有同样的性能优势。无耻地献上自己的 [ 跑分] ( /benchmark.html )
11
11
* 非常易于使用的 api,允许你使用任何风格或者混搭的方式来解析 JSON。给你前所未有的灵活性。来看看这些 [ API们] ( /api.html ) 是不是真的有那么好用吧
12
12
* 独特的 iterator api 能够直接遍历 JSON,极致性能!0 内存分配!这样的 [ iterator] ( /api.html#iterator-api ) 你绝对没有用过
13
+ * 数据绑定的每一个步骤都可以被定制,参见 [ java] ( /java-extension.html ) 和 [ go] ( /go-extension.html ) 版本的扩展文档。
13
14
14
15
# 自卖自夸
15
16
@@ -36,6 +37,23 @@ int[] val = iter.read(int[].class);
36
37
System . out. println(val[3 ]);
37
38
```
38
39
40
+ 可以把数据直接绑定到已有的对象上
41
+
42
+ ``` java
43
+ public static class TestObj1 {
44
+ public String field1;
45
+ public String field2;
46
+ }
47
+
48
+ TestObj1 testObj = new TestObj1 ();
49
+ testObj. field2 = " world" ;
50
+ JsonIterator iter = JsonIterator . parse(" { 'field1' : 'hello' }" . replace(' \' ' , ' "' ));
51
+ iter. read(testObj);
52
+
53
+ System . out. println(testObj. field1); // "hello"
54
+ System . out. println(testObj. field2); // "world"
55
+ ```
56
+
39
57
使用 Go bind-api
40
58
41
59
``` go
You can’t perform that action at this time.
0 commit comments