Refresh Your Java - Before Java Interview
We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....
JAXB:
The JAXB binding
compiler translates a W3C XML Schema into one or more Java
classes,
a jaxb.properties file, and possibly other
files, depending on the specific implementation
of JAXB.
Alternatively, JAXB2 offers a way to generate a schema from
annotated Java classes.
Below is the call to
generate the JAXB classes from an XML schema:
xjc -d
out Example.xsd
XMLBeans:
XMLBeans is an
XML binding tool that has full XML Schema support, and offers full
XML Infoset
fidelity. It takes a different approach to
that of most other O/X mapping frameworks,
in that all
classes that are generated from an XML Schema are all derived from
XmlObject,
and contain XML binding information in
them.
Below is the call to generate the JAXB
classes from an XML schema:
scomp -d out
-srconly Example.xsd
Both XMLBeans and JAXB produce Java
models that make it easy for developers to interact with
XML.
The JAXB model however is annotated POJOs
which has the following advantages:
i) JPA
annotations could easily be applied to the JAXB model enabling the
model to be persisted
in a relational database.
ii) Once generated the JAXB model could be modified to handle
changes in the XML schema,
the XMLBeans model would need
to be regenerated.
iii) Starting with Java SE 6 no
additional compile/runtime dependencies are required
for
the JAXB model.
iv)There are multiple JAXB
implementations available: EclipseLink MOXy,
Metro,
Apache JaxMe, etc.
v)JAXB is the
standard binding layer for JAX-WS (SOAP) and JAX-RS (RESTful) Web
Services.
vi) In XMLbeans you can traverse any element
by using Xpath/XQuery, but in Jaxb.
This Portal is intended to put all Java/J2ee related topics at one single place for quick referance, not only Technical , but also the Project Management Related thing such as Development Process methodoogies build process, unit testing etc.,
This Portal has More than 500 Java Interview Questions (also could be Considered as Quick Notes) very neatly separated topic by topic with simple diagrams which makes you easily understandable. Importantly these are from our Realtime expericance.