HTML5 Canvas
Written by: Simon Sarris
Featured Refcardz: Top Refcardz:
  1. Apache Hadoop
  2. Web Driver
  3. MVVM
  4. REST
  5. ADO.NET
  1. HTML5
  2. Ajax
  3. jQuery Selectors
  4. CSS Part 1
  5. Git

Link Details

Link 291677 thumbnail
User 475660 avatar

By Juwit
via juwit.blogspot.com
Published: Nov 16 2009 / 14:55

JAXB (Java Architecture for XML Binding) is one of the JEE API. It permits to create a mapping between Java objects and XML elements, by annotating POJOs (Plain Old Java Objects), as it is done in JPA to create an object/database mapping. JAXB is mainly used in JAX-WS (Java API for XML Web Services) to handle SOAP messages and their content with java objects. In this article, I propose another way to use JAXB to persist java objects. In many applications, it can be useful to persist objects in XML, for instance in desktop applications.
  • 15
  • 0
  • 2954
  • 4

Comments

Add your comment
User 388907 avatar

MCII replied ago:

0 votes Vote down Vote up Reply

"This part covers the annotation of existing classes to make them managable by JAXB. This approach has one major advantage : you don't have to write an XML Schema"

For JAXB generating code from a Schema is the gist. Avoiding the Schema is not an 'advantage'.

User 475660 avatar

Julien Wittouck replied ago:

0 votes Vote down Vote up Reply

I agree, the word "advantage" isn't appropriate here. My point here was to show how to use existing classes (JPA-annotated ones for instance), and not re-generate them from a schema, avoiding erasing legacy code.
The best usage will be, of course, writing a schema and map it to the annotated classes.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.