To marshal/unmarshal a list with a JAXB (JSR-222) implementation you need to create a wrapper object to hold the list. People find this onerous having to create multiple wrapper objects for this purpose. Below I'll demonstrate that in reality you only need to create one. This post is based on an answer I gave on Stack Overflow.
November 15, 2012
Creating a Generic List Wrapper in JAXB
Labels:
Collection Property,
JAXB,
XmlAnyElement,
XmlRootElement
November 14, 2012
Using JAXB With XSLT to Produce HTML
JAXB (JSR-222) enables Java to treat a domain model as XML. In this post I will demonstrate how to leverage this by applying an XSLT stylesheet to a JAXB model to produce HTML. This approach is often leveraged when creating JAX-RS applications.
November 1, 2012
Applying a Namespace During JAXB Unmarshal
For some an XML schema is a strict set of rules for how the XML document must be structured. But for others it is a general guideline to indicate what the XML should look like. This means that sometimes people want to accept input that doesn't conform to the XML schema for some reason. In this example I will demonstrate how this can be done by leveraging a SAX XMLFilter.
Subscribe to:
Posts (Atom)