Skip to content

Commit 9cc10db

Browse files
authored
Update README.md
1 parent 458b4e1 commit 9cc10db

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,20 @@ String json = "{\"date_as_long\" : 1411455611975}";
235235
Date date = JsonPath.parse(json).read("$['date_as_long']", Date.class);
236236
```
237237

238-
If you configure JsonPath to use the `JacksonMappingProvider` you can even map your JsonPath output directly into POJO's.
238+
If you configure JsonPath to use `JacksonMappingProvider` or GsonMappingProvider` you can even map your JsonPath output directly into POJO's.
239239

240240
```java
241241
Book book = JsonPath.parse(json).read("$.store.book[0]", Book.class);
242242
```
243243

244+
To obtainin full generics type information, use TypeRef.
245+
246+
```java
247+
TypeRef<List<String>> typeRef = new TypeRef<List<String>>() {};
248+
249+
List<String> titles = JsonPath.parse(JSON_DOCUMENT).read("$.store.book[*].title", typeRef);
250+
```
251+
244252
Predicates
245253
----------
246254
There are three different ways to create filter predicates in JsonPath.

0 commit comments

Comments
 (0)