Option # 1 - Change Access Type
By default, the JAXB implementation (JSR-222) will handle all public fields and properties. If you want to limit this to only public properties, you can do the following:
@XmlAccessorType(XmlAccessType.PROPERTY) public class Foo { public int bar;
Option number 2 - indicate that the field is not displayed
You can mark the field / property with @XmlTransient so that it does not display.
public class Foo { @XmlTransient public int bar;
source share