Skip to content

Commit 9b3fe9c

Browse files
authored
Update index.md
1 parent 489b79a commit 9b3fe9c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jsoniter (json-iterator) is fast and flexible JSON parser available in [Java](ht
1010
* Jsoniter is the fastest JSON parser. It could be up to 10x faster than normal parser, data binding included. Shameless self [benchmark](/benchmark.html)
1111
* Extremely flexible api. You can mix and match three different styles: bind-api, any-api or iterator-api. Checkout your [api choices](/api.html)
1212
* Unique iterator api can iterate through JSON directly, zero memory allocation! See how [iterator](/api.html#iterator-api) works
13+
* Every steps of the data binding process can be customized, checkout extension guide for [java](/java-extension.html) and [go](/go-extension.html) version
1314

1415
# Show off
1516

@@ -36,6 +37,23 @@ int[] val = iter.read(int[].class);
3637
System.out.println(val[3]);
3738
```
3839

40+
You can also read into a existing object
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+
3957
Parse with Go bind-api
4058

4159
```go

0 commit comments

Comments
 (0)