I have a webservice-standard I have to follow, got a xsd and want to generate the Java classes. Some classes with enums are generated properly, but some are empty and don't have values.
For example this one
<xsd:simpleType name="ST_Month">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="01">
<xsd:annotation>
<xsd:documentation xml:lang="de">January</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="02">
<xsd:annotation>
<xsd:documentation xml:lang="de">February</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
...
</xsd:restriction>
</xsd:simpleType>
is generated correctly to
@XmlType(name = "ST_Month")
@XmlEnum
public enum STMonth {
/**January */
@XmlEnumValue("01")
VALUE_1("01"),
/** February */
@XmlEnumValue("02")
VALUE_2("02"),
...
}
But some enums have abstract superclasses like this:
<xsd:complexType name="STE_Country" abstract="true">
<xsd:simpleContent>
<xsd:extension base="xsd:string"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="STE_CountryBasic" final="#all">
<xsd:simpleContent>
<xsd:restriction base="dt:STE_Country">
<xsd:enumeration value="01">
<xsd:annotation>
<xsd:documentation>USA</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="02">
<xsd:annotation>
<xsd:documentation>GERMANY</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
The result of the generation is this:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "STE_CountryBasic")
public class STECountryBasic extends STECountry
{
}
I also added my own complexType for 'MyOwnCountry' with country values that are missing in STE_Country but needed in my application. But the generated class is the same empty result as STECountryBasic.
What do I have to do so the enum-values in STECountryBasic are generated?
Additionally, I'm generating via maven with the cxf-codegen-plugin