JAXB Overview:
JAXB stands for Java Architecture for XML Binding (JAXB). It provides the functionality of converting java objects to and from xml.
Note: Marshalling is the process of converting java object into xml file. Unmarshalling is the process of converting xml into java object.
JAXB Annotations:
1. @XmlRootElement: It is used to define the xml root element. Default is class name.
2. @XmlType: It is used to define the order in which xml elements are written.
3. @XmlElement: It is used to define the field which have to be included in the xml file.
4. @XMLTransient: It is used to define the field which not have to be included in xml file.
5. @XmlAttribute: It is used to define the attribute.
Java JAXB tutorial:
- JAXB marshalling – convert java object to xml example using one pojo
- JAXB marshalling – convert java object to xml example using multiple pojo
- JAXB unmarshalling – convert xml into java object example