Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java: xpath on json [closed]

I need a fast way to extract data from json responses a I get from a webservice.

By fast, I mean fast for the programmer, not necessarily for the computer.

I was thinking of something like Xpath for Json, if such a thing exists.

Any ideas? I am open to any Java Json library. In fact, the easiness to extract data from Json with a powerful querying language will be central to the choice of json library.

like image 436
flybywire Avatar asked Aug 12 '10 18:08

flybywire


2 Answers

Jackson JSON Processor has been used in a lot of frameworks. The tree model or data binding approach is probably the easiest to work with.

like image 162
Tim R Avatar answered Nov 07 '22 05:11

Tim R


JsonPath emerged as a de facto standard for such tasks. A Java implementation:

https://github.com/nebhale/JsonPath

It seems well maintained and works fine.

like image 26
Alexis Dufrenoy Avatar answered Nov 07 '22 06:11

Alexis Dufrenoy