I have a pojo class
where return type of variable is JAXBElement<String>
. I want to store it in a String
. Can someone explain how to do it?
File file = new File("C:/Users/Admin/Desktop/JubulaXMLFiles/DemoWithDrools_1.0.xml");
JAXBContext jaxbContext = JAXBContext.newInstance(Content.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
Content e=(Content) jaxbUnmarshaller.unmarshal(file);
String retrivedValue = (String)e.getProject().getName().toString();
System.out.println(retrivedValue);
Output is like javax.xml.bind.JAXBElement@5a99da
. But I want to retrieve the string value in retrivedValue
.