Hi,
I was wondering if you would consider adding a new decorator to the codegen that adds a @Nullable annotation on getters that might return a null value, based on the cardinality defined in the XSD.
For example,
<xs:element name="Foo" type="xs:string" minOccurs="0"/>
would generate the following getter:
@javax.annotation.Nullable
public String getFoo() { }
Also, things like choices would also result in nullable getters:
<xs:sequence>
<xs:choice>
<xs:element name="foo" type="xs:string"/>
<xs:element name="bar" type="xs:string"/>
</xs:choice>
</xs:sequence>
would result in:
@javax.annotation.Nullable
public String getFoo() { }
@javax.annotation.Nullable
public String getBar() { }
I started working on such a decorator, I think I have something that works pretty well on my XSD but I'm not sure it's 100% correct, and I would rather use an officiel decorator that is bundled with JiBX.
Hi,
I was wondering if you would consider adding a new decorator to the codegen that adds a
@Nullableannotation on getters that might return anullvalue, based on the cardinality defined in the XSD.For example,
would generate the following getter:
Also, things like choices would also result in nullable getters:
would result in:
I started working on such a decorator, I think I have something that works pretty well on my XSD but I'm not sure it's 100% correct, and I would rather use an officiel decorator that is bundled with JiBX.