I would like to extract the element name of all the types defined in my XML. Here is my code
JAXBElement object = (JAXBElement) unmarshaller.unmarshal(new FileInputStream("sample.xml")); //this works fine System.out.println( object.getName());
ConfigType type = (ConfigType)object.getValue(); Type1 type1 = type.getType1();
I am not able to get the elementname for type1 because it is not JAXBElement. Is there some way to convert it into JAXBElement ? I tried by passing type1 JAXBIntrospector , it printed null for element name. Please help me.