CompanyDepartmentEmployee (name, job title, age)Acme Inc.SalesJohnny, Sales rep, 45Sarah, Sales rep, 33Magda, Office ass
Company
Department
Employee (name, job title, age)
Acme Inc.
Sales
Johnny, Sales rep, 45
Sarah, Sales rep, 33
Magda, Office assistant, 27
Accounting
Steve, Head controller, 51
Peter, Assistant controller, 31
Susan, Office assistant, 27
With that in place, let's start using JXPath!
The simplest query possible extracts a single object from the object tree. For example, to retrieve Company
, use the following code:
JXPathContext context = JXPathContext.newContext(company);Company c = (Company)context.getValue(".");
--结束END--
本文标题: Java object queries using JXPath
本文链接: https://lsjlt.com/news/232393.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0