How XML binding can be achieved in Java ?

  • Java offers several options for handling XML structures and files.
  • One of the most common and used ones is JAXB.
  • JAXB stands for Java Architecture for XML Binding.
  • It offers the possibility to convert Java objects into XML structures and the other way around.
  • JAXB comes with the JRE standard bundle since the first versions of the JRE 1.6.
  • JAXB Binding gives Java developers an efficient and standard way of mapping between XML and Java code.
  • Java developers using JAXB Binding are more productive because they can write less code themselves and do not have to be experts in XML.
  • JAXB Binding makes it easier for developers to extend their applications with XML and Web Services technologies.

The binding process includes following steps:

  1. Binding
    • Binding a schema means generating a set of Java classes that represents the schema.
  2. Marshalling
    • Convert Java objects into XML structures.
  3. Unmarshalling
    • Convert XML structures into Java objects.