Trying to become a Java software developer for the third time since 2004, now alone, with life obstacles and important people creating difficulty in the path here and there...
Carey Brown wrote:Mostly new stuff to me but I'll take a stab at it.
Messages (plural) is a class to encapsulate a collection of Message objects. So far, so good.
Data should be using the Messages class and not attempting to define it's own "messages" collection.
Trying to become a Java software developer for the third time since 2004, now alone, with life obstacles and important people creating difficulty in the path here and there...
Stephan van Hulst wrote:I strongly recommend you to use the JAXB API instead though, and just use Jackson as an implementation provider.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Stephan van Hulst wrote:This should work:
I strongly recommend you to use the JAXB API instead though, and just use Jackson as an implementation provider.
Trying to become a Java software developer for the third time since 2004, now alone, with life obstacles and important people creating difficulty in the path here and there...
Tim Holloway wrote:
Stephan van Hulst wrote:I strongly recommend you to use the JAXB API instead though, and just use Jackson as an implementation provider.
Another alternative is to use the Apache Digester. It is specifically designed to convert XML into a graph of Java objects and is widely used in products like the Tomcat webapp server, which digests not only the Tomcat server config file into a graph of JavaBeans, but also deals with digesting webapp deployment descriptors (Context.xml, /WEB-INF/web.xml).
Trying to become a Java software developer for the third time since 2004, now alone, with life obstacles and important people creating difficulty in the path here and there...
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Trying to become a Java software developer for the third time since 2004, now alone, with life obstacles and important people creating difficulty in the path here and there...
Marcos Silvestri wrote:I've managed to resolve my problems with JDOM
Marcos Silvestri wrote:Would you have any suggestions to me so that I can fetch the data already present after the successful deserialization?
Stephan van Hulst wrote:
Marcos Silvestri wrote:I've managed to resolve my problems with JDOM
I'm glad you got it to work. It's just a pity that you ditched a high level, strongly typed API for a low level, weakly typed API. Your old approach was more elegant and robust.
Marcos Silvestri wrote:Would you have any suggestions to me so that I can fetch the data already present after the successful deserialization?
Literally just replace all the contents of your ApiResponse class with the code I posted. After deserializing it using XmlMapper you can just do this:
Trying to become a Java software developer for the third time since 2004, now alone, with life obstacles and important people creating difficulty in the path here and there...
Attractive, successful people love this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|