users@jaxb.java.net

Re: Q: Does JAXB handle elements with minOccurs="0" correctly?

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 17 Nov 2004 15:43:51 -0800

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

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net