Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • 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?

(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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!