users@jaxb.java.net

JAXB / enumerations

From: DOERR Beat <bdoerr_at_publigroupe.com>
Date: Thu, 9 Oct 2008 10:47:51 +0200

Hello

Is it possible to convert enumerations in XML schemas to Java enum types with the binding compiler?

  <xs:simpleType name="ContractTypeCV">
    <xs:annotation>
      <xs:documentation>Contract type codes.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="StringType">
      <xs:enumeration value="0" pg-md:longName="Standard"/>
      <xs:enumeration value="1" pg-md:longName="Basis"/>
      <xs:enumeration value="2" pg-md:longName="Parallel"/>
    </xs:restriction>
  </xs:simpleType>

Cheers, Beat Doerr