We have an xsd schema with a declaration like this:
<xsd:simpleType name="customId">
<xsd:annotation>
<xsd:appinfo>
<jaxb:javaType name="com.company.identifiers.CustomId" parseMethod="fromString" printMethod="toString"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:restriction base="xsd:int" />
</xsd:simpleType>
Then, I want to have a list of this type in a generated Java class:
<xsd:complexType name="SomeMessage">
...
<xsd:attribute name="customIds" use="optional">
<xsd:simpleType>
<xsd:list itemType="customId" />
</xsd:simpleType>
</xsd:attribute>
...
</xsd:complexType>
But the field customIds, for some reason, is generated as List<String>.
I guess, xsd:sequence could be used instead of xsd:list, but SomeMessage already has an xsd:choice, and as far as I get, it is illegal to have xsd:sequence in the same declaration.
Thanks!
Code generated using NetBeans 7.1.2, running on Java 1.7.0_02.
If you want to map simple types to Java classes, one way to do is to globally set
mapSimpleTypeDef="true"Generated code:
If you want to refer your pre-existing CustomId class, then the following works in my case:
You’ll get the following:
And the generated Adapter1: