There appears to be a misconception that annotations are required on the model in order to use a JAXB (JSR-222) implementation. The truth is that JAXB is configuration by exception, so annotations are only required when you want to override default behaviour. In this example I'll demonstrate how to use JAXB without providing any metadata.
Showing posts with label Unmarshaller. Show all posts
Showing posts with label Unmarshaller. Show all posts
July 30, 2012
JAXB - No Annotations Required
September 30, 2011
Mixing Nesting and References with JAXB's XmlAdapter
Recently I came across a question on Stack Overflow asking if JAXB could marshal the first occurrence of an object as containment and all subsequent occurrences as a reference. Below is an expanded version of my answer (up votes appreciated) demonstrating how this can be achieved by leveraging JAXB's XmlAdapter.
August 23, 2011
JAXB and Java IO (Files, Streams, Readers, and Writers)
JAXB supports many different XML sources and targets. In this post I'll give an overview of how JAXB can be used with those found in the java.io package: File, InputStream, OutputStream, Reader, Writer and their subclasses.
December 20, 2010
JAXB and Marshal/Unmarshal Schema Validation
In a previous post I described how to validate an object model (mapped with JAXB annotations) against an XML schema using the javax.xml.validation APIs. In this post I'll describe how to leverage those APIs during unmarshal and marshal operations.
Labels:
JAXB,
Marshaller,
Unmarshaller,
Validation,
XML Schema
Subscribe to:
Posts (Atom)