Community
Participate
Working Groups
There appears to be an error when using @XmlPath with @XmlEnum. For the following example: @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class Customer { @XmlPath("nested/type/text()") private CustomerType type = CustomerType.NEW_CUSTOMER; @XmlEnum(String.class) private enum CustomerType { PROMO_CUSTOMER, NEW_CUSTOMER, VIP, NORMAL } } When the following XML document is unmarshalled the type property is not set: <customer> <nested> <type>NEW_CUSTOMER</type> </nested> </customer> Everything works properly when @XmlElement is used instead of @XmlPath
Created attachment 187052 [details] MOXy - Fix When an Enum property was marked with an @XmlPath annotation, the specified XPath was being ignored and an XPath was derived from the field/property name. Fix: Modified the MappingsGenerator.getXPathForField to always account for an XPath being specified on the property.
Created attachment 187128 [details] MOXy - Test Cases
Fix checked into trunk at rev: 8850 Code reviewed by: Matt MacIvor
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink