File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -235,12 +235,20 @@ String json = "{\"date_as_long\" : 1411455611975}";
235235Date 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
241241Book 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+
244252Predicates
245253----------
246254There are three different ways to create filter predicates in JsonPath.
You can’t perform that action at this time.
0 commit comments