I have a class Book defined and I want to create a JAXBElement object that will contain the information corresponding to the XML from the String object.
For example, I can have something like:
String code = "<book><title>Harry Potter</title></book>";
Now, I want to create a JAXBElement, starting from that string. I need the string to do some validations that I cannot do using JAXBElement.
So, can I do what I want? If yes, how?
Thanks!
Sorin
If you use one of the
unmarshalmethods that takes aClassparameter you will receive an instance ofJAXBElement.Demo
Book