Showing posts with label XmlAccessorType. Show all posts
Showing posts with label XmlAccessorType. Show all posts

April 5, 2012

JAXB and Unmapped Properties

JAXB (JSR-222) is configuration by exception, meaning that there is a default mapping applied to domain objects.  This means that sometimes you need to explicitly exclude a field/property.  In this post I'll discuss how this can be done using @XmlTransient or @XmlAccessorType(XmlAccessType.NONE) and when each option is appropriate.

February 9, 2012

JAXB's @XmlType and propOrder

In this post I will demonstrate how to use the propOrder property on the @XmlType annotation to control the ordering of XML elements.  I will also discuss the impact of @XmlAccessorType on how propOrder is configured.

June 24, 2011

Using JAXB's @XmlAccessorType to Configure Field or Property Access

JAXB offers a lot of flexibility when interacting with your object model.  One area is configuring the use of fields or properties to access the data in your domain objects.  This is specified as an XmlAccessType (PUBLIC_MEMBER, PROPERTY, FIELD, or NONE) via the @XmlAccessorType annotation.  In this post we'll examine what these options really mean.