Raj
Raj

Reputation: 21

.getContent() method generation issue in Jaxb class

i am having issue while regenerating the JAXB classes.my previous xsd generated the below method automatically through JAXB class generation .

public List<Serializable> getContent() {
        if (content == null) {
            content = new ArrayList<Serializable>();
        }
        return this.content;
    }

But my new XSD did not.

<xsd:element name="AppInfo">
    <xsd:complexType>
        <xsd:complexContent>
            <xsd:extension base="AppInfo_Type"/>
        </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:complexType name="AppInfo_Type">
<xsd:sequence>
        <xsd:element ref="a" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element ref="b" maxOccurs="unbounded"/>
                    </xsd:sequence>
    <xsd:attribute name="id" type="ID"/>
</xsd:complexType>

What will drive this method generation in XSD?

Upvotes: 2

Views: 552

Answers (1)

Azee
Azee

Reputation: 1829

Add a mixed="true" attribute to your ComplexType:

<xsd:complexType name="AppInfo_Type" mixed="true">

Upvotes: 1

Related Questions