Quantcast
Channel: JAXB 2.x: How to unmarshal an XML without knowing the target class? - Stack Overflow
Browsing all 5 articles
Browse latest View live

Answer by Alex for JAXB 2.x: How to unmarshal an XML without knowing the...

So how do you do unmarshalling so that you get an instance of Z and then you can test >AFTER unmarshalling, what it is? e.g. z instanceof A then... z instanceof B then >something else...etc....

View Article



Answer by basZero for JAXB 2.x: How to unmarshal an XML without knowing the...

THERE IS NO SOLUTION TO MY QUESTION! Under any circumstances you have to tell the unmarshaller exactly what object it should unmarshall to.

View Article

Answer by basZero for JAXB 2.x: How to unmarshal an XML without knowing the...

There is a similar question here. Is it possible, to just unmarshall by providing Person.class and the unmarshaller finds out itself, whether it has to unmarshall to ReceiverPerson.class or...

View Article

Answer by Fabian Tschachtli for JAXB 2.x: How to unmarshal an XML without...

Every XML Documents Must Have a Root Element and if you want to use the same UnMarshaller for both instances your only possibility is to have a common root element such as: <root>...

View Article

JAXB 2.x: How to unmarshal an XML without knowing the target class?

If there is a way, how to do this, I'd like to know the most elegant one. Here is the question: - Let's assume you have an abstract class Z - You have two classes inherited from Z: named A and B. You...

View Article

Browsing all 5 articles
Browse latest View live




Latest Images