Java – query of JAXB objects by XPath 1.0?

JAXB is a great, real time, but it is still very time-consuming to traverse the final object tree; Almost as bad as working directly with dom

Is there a way that I can execute XPath 1.0 queries on jaxbelement without having to carefully transfer documents to the DOM model every time?

Solution

Not directly, but you can use Apache Commons jxpath, which allows you to run XPath queries across any object graph, not just JAXB bound It can run in "loose" mode, which is zero tolerance

It is very convenient to replace these NPE prone graphical navigation

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>