Let xjc NOT use inheritance for XSD inheritance

42 views Asked by At

I have this XSD/WSDL:

<xs:complexType name="SupplierArticle">
    <xs:complexContent>
        <xs:extension base="Article">
            <xs:attribute name="supplierArticleId" type="xs:string"/>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>
<xs:complexType name="Article">
    <xs:attribute name="name" type="xs:string" use="required"/>
    <xs:attribute name="articleId" type="xs:string" use="required"/>
    <xs:attribute name="ean" type="xs:string"/>
    <xs:attribute name="isbn" type="xs:string"/>
</xs:complexType>

jxc will generate two classes Article & SupplierArticle. And SupplierArticle will inherit all from Article.

There are two things I want: I want to determine/fix the order of the attributes in the final XML produced. And when I cannot do that (which is what I found when I tried to add the propOrder to the XmlType annotation of the SupplierArticle) I want the SupplierArticle to no longer inherit from Article but fully implement all attributes of Article inside the SupplierArticle.

Is this possible? (Using some settings or some plugin) And if so: how?

(The other solution would be that all properties of the super would go first as is indicated on some location on the internet but that does not seem to happen either.)

(I'm using Java 17 and I already am using jaxb-tools)

0

There are 0 answers