is it possible to set the @XmlRootElement in runtime?
i have a class that i need to convert to xml, but this class should be converted to more than one XML and the only different is the root element name.
is it possible to set the @XmlRootElement in runtime? i have a class that
Share
If the class represents an XML schema type that can be used by more than one element name then it should not be annotated
@XmlRootElement. Instead it should be annotated@XmlType, and when you want to marshal an instance ofMyTypeto XML you wrap it in aJAXBElement<MyType>that specifies the element name.