*
The moose likes XML and Related Technologies and the fly likes JAXB with legacy beans?  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "JAXB with legacy beans?  " Watch "JAXB with legacy beans?  " New topic
Author

JAXB with legacy beans?

Brian Mulholland
Ranch Hand

Joined: Mar 12, 2009
Posts: 61
Let's say I have a bean structure not generated from an XSD by JAXB, but which is FAIRLY close to the XML structure. Is there some annotation way I can direct JAXB how to unmarshal from XML to a library of legacy beans by using annotations?

(update)
A little more detail. Let's say I have an XML document that looks like:


I want to bind it to an object that has a List<String> as a property. I can add annotations easily, but don't want to unwind the code that references the java object, and the XML is being produced by a third party. I am daydreaming of an annotation that allows me to tell JAXB that it should dump the text node from each listitem node into the List<String>. I have a variety of similar things, but am hoping that once I see how one is done, i can extrapolate to other situations.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAXB with legacy beans?
 
Similar Threads
Simple Java to XML binding (NOT vice versa)
Web App Design
@Entity to XML
DOM and SAX
JAX-WS Question