Hi - JAXB how to get element name

  • From: Prabhu Ramani <prabhu.ramani@...>
  • To: dev@..., issues@..., users@...
  • Subject: Hi - JAXB how to get element name
  • Date: Wed, 27 Mar 2013 11:42:11 -0700


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.


Hi - JAXB how to get element name

Prabhu Ramani 03/27/2013
Terms of Use; Privacy Policy; Copyright ©2013-2016 (revision 20160708.bf2ac18)
Please Confirm