03 Marshalling and Unmarshalling
Marshalling - is the process of converting Java objects into xml.
Unmarshalling - is the process of converting XML into Java Objects.
We do this in webservice world or the frameworks like Apache CXF or SOA Engines within Apache CXF.
Step to Marshall
Right click on source → main → new class

Choose option to Main Method and then Give a class name

We start it by creating the JAXBContext.
ex. JAXBContext context = JAXBContext.newInstance(XYZClass.class);Next create a Marshaller → context.createMarshaller();
Now create a class object → ex. XYZClass xyz = new XYZClass();

Steps to Deserialize
Create a instance of Unmarshaller
ex. Unmarshaller unmarshaller = context.createUnmarshaller();Create a reader
XYZClass xyz = unmarshaller.unmarshal( new StringReader( writer.toString() ));

Full Code

Question 1: The process of converting java objects in to XML is called → Marshalling
Compiling
Unmarshalling
Marshalling
Deserialization
Question 2: The entry point in to the JAXB Runtime API is → JAXBContext
Marshaller
JAXBContext
xjc
schemagen