Skip to main content
Spin can deserialize XML to Java objects and serialize the annotated Java objects to XML by integrating mapping features into its fluent API. JAXB annotations can be added to the involved Java classes to configure the (de-)serialization process but are not required.

Mapping between Representations:

Assume we have a class Customer defined as follows:

Mapping XML to Java:

We can map the following XML object
to an instance of Customer in the following way:

Mapping Java to XML:

We can map the customer back to XML as follows: