JAXB Tutorial in Java

In this tutorial we will learn what is the significance of  JAXB in Java.

JAXB  stands for Java Architecture for XML Binding, which is using to convert java object to/from XML

Marshalling: JAXB provides support to convert java object to XML.

Unmarshalling: JAXB provides support to convert XML to a JAVA Object.

Let’s run a small program using JAXB API.

@XmlRootElement defines the root element of an xml document.

@XmlAttribute defines the attribute of the root element.

@XmlElement defines the sub element of the root element.

 

 

 

OUT PUT:

 

 

Posted in JAXB and tagged .

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">