users@jaxb.java.net

Nillable, minOccurs="0", maxOccurs="unbounded", JAXBElement necessary?

From: <slapnutcity_at_hotmail.com>
Date: Mon, 31 Dec 2012 11:47:00 +0000 (GMT)

I've got an XSD (a part of a bigger XSD which I do not have control
over), which is provided below.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="foo">
        <xsd:complexType>
                <xsd:sequence>
                        <xsd:element name="bar" type="xsd:string"
nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
        </xsd:complexType>
  </xsd:element>
</xsd:schema>

I has an element "bar" which is of type "string", is nillable, does not
have to occur, but it can also occur more than once. I've understood to
make a difference between a nillable element and an element not
provided, a JAXBElement is used.

When I generate classes by using xjc, I get a class Foo with a
List<String> bar.Isn't it supposed to be List<JAXBElement<String>> bar?
If not, how can I make the difference between a value not provided and
a nil value? When it is a nil value, it should be able to hold an
attribute defining it has "noValue" (part of the specification I'm
working with).