Reputation: 1287
I'm using XML schemas and generating java files with xjc to be used with JAXB. The java files that are generated have the default @XmlAccessorType(XmlAccessType.FIELD) specified. I would like to change this so that the resultant java files have PROPTERY access annotated ( @XmlAccessorType(XmlAccessType.PROPERTY ) ) and not have the @XmlElement / @XmlAttribute annotations generated at the field level. Is there a way to accomplish this via a custom bindings file?
Upvotes: 5
Views: 1592
Reputation: 1613
It doesn't look like you can do this with a binding customization. However, if you want all of the generated classes from one xjc run to have @XmlAccessorType(XmlAccessType.PROPERTY), you can use the propertyaccessors extension for xjc:
xjc -Xpropertyaccessors ...
You should use a recent version of xjc because this plugin was not registered correctly as of as 2.2.4.
Upvotes: 0