• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB with legacy beans?  RSS feed

Brian Mulholland
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!