Kohsuke,
Thank you for your quick reply.
I am aware of the 'generateIsSetMethod' customization and I can use this
work-around. But it's unfortunate (IMHO) and somewhat clumsy that I either
have to add this annotation to every element that has a minOccurs="0"
constraint (and this will only work well, by the way, when I control the
schema file) or add it at the schema level (e.g in a JAXB binding file) and
live with the fact that I then end up with isSetXXX, unsetXXX methods on
properties that are always set and cannot be unset (because their minOccurs
constraint is 1 or greater).
Might I suggest that xjc (or the customization) was modified a bit so that it
automatically generated isSetXXX() / unsetXXX() methods for elements or
attributes for which this is meaningful (e.g. minOccurs="0") ? To me, this
would seem like a better solution.
Kind regards,
Jacob
On Thursday 18 November 2004 00:43, Kohsuke Kawaguchi wrote:
> Jacob Lauemøller wrote:
> > My question is: Given a Foobar instance, how do I determine wether or not
> > element <b> occurred in a document?
> >
> > FYI, for the same schema, Apache Axis will generate a Java class for
> > <foobar> which maps <b> to java.lang.Integer, allowing the getter to
> > return null when <b> does not occur in the unmarshalled document.
>
> There's a customization that gives you "isSetB"/"unsetB" method.
>
> See
> http://archives.java.sun.com/cgi-bin/wa?A2=ind0306&L=jaxb-interest&F=&S=&P=
>1202
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net