开发者

java: xpath on json [closed]

开发者 https://www.devze.com 2023-01-11 13:47 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_运维问答

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 6 years ago.

Improve this question

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.


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.


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.


https://github.com/jayway/JsonPath

Similar to @alexis-dufrenoy's answer -- but it looks like a more active project.

Disclaimer: I have not tried @nebhale's system, so I can't judge which is best.

0

精彩评论

暂无评论...
验证码 换一张
取 消