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.
September 30, 2011
Mixing Nesting and References with JAXB's XmlAdapter
September 8, 2011
Mapping Objects to Multiple XML Schemas - Weather Example
I have written previous posts on EclipseLink JAXB (MOXy)'s @XmlPath and external binding file extensions. In this post I will demonstrate how powerful these extensions are by mapping a single object model to two different XML schemas. To make the example more "real", the XML data will come from two different services that provide weather information: Google and Yahoo.
Labels:
EclipseLink,
Extension,
JAXB,
Mapping File,
MOXy,
XmlPath
Subscribe to:
Posts (Atom)