Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Serious JAXB Limitation?  RSS feed

James Montgomery
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings all,
I am working on an application that currently unmashalls XML documents into Java objects using DOM -- i.e., it walks through the DOM nodes and builds a hierarchy of Java objects.
When I first heard about JAXB, I thought it might be a better choice than our current implementation. Rather than a bunch of tedious DOM calls, we could just define the appropriate mappings and let the JAXB framework handle it.
Upon closer inspection, however, I realized that JAXB can not unmarshall XML into instances of my existing Java classes. Unmarshalling only produces instances of JAXB-generated "content classes".
Granted, unmarshalling XML into JAXB content classes, and then mapping these content classes into my own classes, may be a little more elegant than our current method of just walking the DOM hierarchy. But it's not quite what I was hoping for.
It seems that there is a better XML - Java mapping tool called Quick, at Sourceforge. I wonder why JAXB doesn't offer any support for pre-existing classes, and whether they plan to in the future.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!