I am using JAXB to generate beans from XSD using the JAXB plugin in Maven. This works great, expect the code to contain isSetXXXXXX () methods for each field.
eg.
for the firstName field, it creates the following code:
@XmlElement(name = "FirstName", required = true) protected String firstName; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.token = firstName; } public boolean isSetFirstName() { return (this.firstName!= null); }
This isSetFirstName () method is causing problems, and I don't want JAXB to generate them.
Is there any way to stop this behavior?
Thanks.
UPDATE
Solved: the problem was in the xjb file, generateIsSetMethod was set to true.
<xs:annotation> <xs:appinfo> <jaxb:globalBindings generateIsSetMethod="true"> bindingStyle="modelGroupBinding" choiceContentProperty="true" > <xjc:serializable uid="12343"/> <jaxb:javaType name="short" xmlType="xs:long" printMethod="javax.xml.bind.DatatypeConverter.printShort" parseMethod="javax.xml.bind.DatatypeConverter.parseShort"/> </jaxb:globalBindings> </xs:appinfo> </xs:annotation>
And that answered my previous question .
adi
source share