给定这样的模式:
<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 将生成类似于以下内容的 Java:
public class GroupType {
@XmlElement(name = "Options", required = true)
protected OptionsType options;
@XmlElement(name = "PageContainer")
protected List<PageContainerType> pageContainer;
...
}
我想为 PageContainer 元素强制执行一个唯一的集合。这是一个逆向工程项目,所以我不太关心确保架构明确执行它。
是否可以通过在模式或 XJC 绑定中指定某些内容来将PageContainer
元素生成为 a ?Set<PageContainerType>