Java: Using XMLAdapter to process custom datatypes using JAXB

JAXB provides a framework for two-way binding between XML and Java structures, making it easy for developers to serialize and deserialize their XML into Java objects.

Decorating a class with @XmlElement and @XmlAttribute annotations is all it usually takes to build a rich domain model from XML, but sometimes you get into a situation where more custom processing is required.

A custom XMLJavaTypeAdapter can help resolve these issues by providing custom methods for marshalling and unmarshalling the XML into the correct Java type.

Continue reading “Java: Using XMLAdapter to process custom datatypes using JAXB”