Given a schema such as this:
<xs:element name="Group" type="GroupType"/>
<xs:complexType name="GroupType">
<xs:sequence>
<xs:element type="OptionsType" name="Options" maxOccurs="1" minOccurs="1"/>
<xs:element type="PageContainerType" name="PageContainer" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PageContainerType">
<xs:sequence>
...
</xs:sequence>
</xs:complexType>
XJC will generate Java something like:
public class GroupType {
@XmlElement(name = "Options", required = true)
protected OptionsType options;
@XmlElement(name = "PageContainer")
protected List<PageContainerType> pageContainer;
...
}
I want to enforce a unique collection for the PageContainer element. This is a reverse-engineering project so I'm not too concerned about making sure the schema enforces it explicitly.
Is it possible to generate the PageContainer
element as a Set<PageContainerType>
, by either specifying something in the schema or in XJC bindings?