Java 如何正确地将对象列表添加到XSD
我的班级看起来像这样Java 如何正确地将对象列表添加到XSD,java,xsd,Java,Xsd,我的班级看起来像这样 <xsd:element minOccurs="0" name="Consents"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="0" name="Marketing" type="ConsentType" /> <xsd:element minOccurs="0"
<xsd:element minOccurs="0" name="Consents">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" name="Marketing" type="ConsentType" />
<xsd:element minOccurs="0" name="CheckExternalDB" type="ConsentType" />
<xsd:element minOccurs="0" name="DocsByEMail" type="ConsentType" />
<xsd:element minOccurs="0" name="DocsByPrintHouse" type="ConsentType" />
<xsd:element minOccurs="0" name="DocsByEBOK" type="ConsentType" />
<xsd:element minOccurs="0" name="DataToGroup" type="TimeConsentType" />
<xsd:element minOccurs="0" name="MarketingGroup" type="TimeConsentType" />
<xsd:element minOccurs="0" name="EMarketingInf" type="TimeConsentType" />
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element minOccurs="0" maxOccurs="unbounded" name="CustomerConsents" type="CustomerConsentsBasic" />
</xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
公共类公司类型{
@XmlElement(name=“同意”)
受保护公司类型。同意书;
}
公共静态类同意{
@XmlElement(name=“CustomerConsents”)
受保护的客户名单;
}
customerConsents是一个列表,我想正确地表示它。上面是我的XSD,如果它在某个地方出错,是否有人可以纠正它
public class CompanyType {
@XmlElement(name = "Consents")
protected CompanyType.Consents consents;
}
public static class Consents {
@XmlElement(name = "CustomerConsents")
protected List<CustomerConsentsBasic> customerConsents;
}