I made a change in the blogger configuration to ease the later work when blogging. It is possible that older entries are not correctly formatted.

Sunday 6 January 2008

JAXB

Another interesting Java technology pushed by Sun is JAXB, it stands for "Java Architecture XML Binding". Most of the information found here comes from Sun's JAXB tutorial. It is a means of coding Java Object into XML using the descriptive power of the XML Schemas. It is possible to generate Java Object from XML descriptions using a Schema. To simplify the process, it is also possible to use JAXB annotations of Java classe in order to generate the schemas needed for such schemas. So the important steps to consider when using this is:
  1. write the classes of the objects which should be stored as XML files, or DOM nodes, etc...
  2. annotate them so that the corresonding schema can be generated
  3. generate content according to schema
  4. unmarshal the content (i.e load into content tree in Java)
  5. validate if required
  6. marshall, i.e export again as XML
This page gives a list of (XML)Schema-Java correspondance tags. As specified, the binding can be generated either using annotations inside the Java files, or it is also possible to use external configuration files outside these files.