By the use of the command line tool 'xjc' for example, it is possible to create Java classes from an existing XML Schema.
I've tried that with a simple XML Schema before:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="employee" type="employee"/>
<xs:complexType name="employee">
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="0"/>
<xs:element name="salary" type="xs:double"/>
<xs:element name="designation" type="xs:string" minOccurs="0"/>
<xs:element name="address" type="address" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="id" type="xs:int" use="required"/>
</xs:complexType>
<xs:complexType name="address">
<xs:sequence>
<xs:element name="city" type="xs:string" minOccurs="0"/>
<xs:element name="line1" type="xs:string" minOccurs="0"/>
<xs:element name="line2" type="xs:string" minOccurs="0"/>
<xs:element name="state" type="xs:string" minOccurs="0"/>
<xs:element name="zipcode" type="xs:long"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
But when I add a definition which has some restrictions, the restrictions will be just ignored. For example:
<xs:element name="Temperature" type="myTemperature"/>
<xs:simpleType name="myTemperature">
<xs:restriction base="xs:double">
<xs:minExclusive value="-273.15"/>
</xs:restriction>
</xs:simpleType>
or
<xs:element name="age">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
All the restrictions like minInclusive, maxInclusive, maxLength, totalDigits, etc. will be ignored. Is there a way to include this restrictions in the creation of the Java classes from the XML Schema?