How to make jxpath read @xmlelement name attribute instead of actual field name?
问题 I have a class with a field which looks like this @XmlElement(name = "Name", namespace = "a:b:c:1", required = true) protected String firstName I want to use JXPath like this String name = (String) context.getValue("Name"); But it doesn't recognize the XMLElement name attribute. Is there any way to make it do so? 回答1: I don't think you can . JXPath allows navigation of bean hierarchies using the standard bean get/is notation, but doesn't provide a means of accessing annotations on a field. I