| Summary: | Support for @XmlType and @XmlRootElement on enums | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Paul Fullbright <paul.fullbright> | ||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | blaise.doughan, martin.grebac, matt.macivor | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
I should note that the exception logged by moxy in this case is: javax.xml.bind.MarshalException - with linked exception: [Exception [EclipseLink-25003] (Eclipse Persistence Services - @VERSION@.@QUALIFIER@): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: An error occurred marshalling the object Internal Exception: Exception [EclipseLink-25007] (Eclipse Persistence Services - @VERSION@.@QUALIFIER@): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: A descriptor for class testenum.FooEnum was not found in the project. For JAXB, if the JAXBContext was bootstrapped using TypeMappingInfo[] you must call a marshal method that accepts TypeMappingInfo as an input parameter.] ... This implies that @XmlType is being ignored as well, I think. Created attachment 213074 [details]
Proposed Fix and Test
Attached patch checked in to SVN in 2.3 and 2.4 streams The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
(found in head code) For the following example: @XmlType @XmlRootElement(name="FOO") public enum FooEnum { @XmlEnumValue("true") TRUE("TRUE!!!"); private final String value; private FooEnum(String value) { this.value = value; } } creating and marshalling a single FooEnum.TRUE should create a document of the form: <FOO>true</FOO> The RI does support this. Note also that the oxm.xsd does not allow for the configuration of either xml-type or xml-root-element on an xml-enum.