I want to convert XML to Java objects. But I do not wish to hard code the mapping between XML tags and Java classes in the code, like for example using JAXB annotations or XStream.alias() method.
How do I achieve this?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Then you should choose an XML parser and design your own unmarshaller. On the other hand JAXB can unmarshall xml into a Java bean without annotations, see this code, it works