Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Java XML to Object Mapping and Back

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working on a system which accepts an XML file and converts the file into local Java Bean type objects for further processing. On completion of processing the system converts the Java Beans into a response XML file and returns the file to the client. I am using Castor to perform the mapping from XML to Object and back to XML. This has been fine until now, but the messages are becoming increasingly complex which is resulting in a mapping file which is hard to read and maintain.

Can anyone please give advise on an alternative to Castor? Preferably one which has a GUI so that I don't have to code mappings by hand. The tool would have to cope with complex data structures and features such as interface/abstract reference variables.

Thanks.
 
Sheriff
Posts: 22655
126
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
XStream doesn't need any configuration, and can also quite easily convert to and from XML.
 
Ranch Hand
Posts: 225
Eclipse IDE Debian Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another option is JAXB, which lets you do the configuration using annotations on the Java classes. Some people really dislike this pattern, though.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic