| Summary: | @XmlPath and @XmlEnum | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Blaise Doughan <blaise.doughan> | ||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | eclipselink.oxm-inbox | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 332770 | ||||||||
| Attachments: |
|
||||||||
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 |
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