JAXB how to get element name
I am trying to get the element name for a JAXB class.
Then if class is SomeElement then what i plan to do is:
getElement(ObjOfSomeElement) --> someelement
I tried the JAXBInstrospector but that requires the classes to have @XMLRootElement.
My generated clases do not have this and i was reading your post for
Why does JAXB put @XmlRootElement sometimes but not always?
I tried that but still the XMLRoot element does not get generated.
I am using JDK 1.7. IS your post still valid and also if there any trial way to get the element name.