Community
Participate
Working Groups
Using Java annotations, the user can have an enum like this: @XmlEnum(String.class) private enum CustomerType { PROMO_CUSTOMER, NEW_CUSTOMER, VIP, NORMAL } Because no @XmlEnumValue annotations were specified, the constant names themselves will be marshalled to XML (e.g. <customer-type>VIP</customer-type>) However in OXM, you are forced to define the constant names twice: <xml-enum java-enum="CustomerType" value="java.lang.String"> <xml-enum-value java-enum-value="PROMO_CUSTOMER">PROMO_CUSTOMER</xml-enum-value> <xml-enum-value java-enum-value="NEW_CUSTOMER">NEW_CUSTOMER</xml-enum-value> <xml-enum-value java-enum-value="VIP">VIP</xml-enum-value> <xml-enum-value java-enum-value="NORMAL">NORMAL</xml-enum-value> </xml-enum> It would be nice if the user could just specify the value once for this default case, such as: <xml-enum java-enum="CustomerType" value="java.lang.String"> <xml-enum-value java-enum-value="PROMO_CUSTOMER"/> <xml-enum-value java-enum-value="NEW_CUSTOMER"/> <xml-enum-value java-enum-value="VIP"/> <xml-enum-value java-enum-value="NORMAL"/> </xml-enum>
It would be even easier if one just got the java settings for free. Does that not exist currently?
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink