Monthly Archives: September 2014

Java XML – JAXB – Java Architecture for XML Binding

Java XML – JAXB – Java Architecture for XML Binding

What is JAXB?

  • Provides API, tools & framework that automate the mapping between XML documents and Java objects
  • Provides compiler that compiles XML schema to Java Classes

Why JAXB?

  • Provides efficient and standard way of mapping between XML and Java Code
  • JAXB is a high level language while JAXP, SAX, DOM are assembly language for XML document management
  • Easy to use, Customizable, portable

http://stackoverflow.com/questions/607141/what-is-jaxb-and-why-would-i-use-it

In JAXB, you are going to create Java classes from XML schema

How to use JAXB?

 JAXB Architecture

JAXB Architecture

 

  • JAXB Binding Compiler is basically xjc: %JAVA_HOME%/bin/xjc
  • Binding Declaration: Binding Customization File
  • XJC creates Java classes from schema
  • Java code reads xml document instance & create into java object (Unmarshal) & object can be them manipulated
  • Java object could be write down to XML document (Marshal)

 

Other Java/XML technologiesSAX, DOM, JAXP

 

Glosarry

– JAXB Entity

– Marshalling

– Unmarshalling

– XSD

– Schema http://www.w3.org/TR/xmlschema-0

 

– schema vs xml

 

– Binding

Resources

Web Services JAXB Basics – Youtube Video

http://www.oracle.com/technetwork/articles/javase/index-140168.html