title: Generate Java Classes with XSD Restrictions built in
body: <p>Working on a large integration project where we are also doing validation on some of the data which we are integrating back and forth. </p>
  
  <p>We are using the CXF-XJC-plugin to generate java classes from XSD and WSDL files.
  It would be very keen to have restrictions added as part of the generated classes, rather than having plain POJO classes. </p>
  
  <p>An example would be:</p>
  
  <pre><code>&lt;xsd:element name="someString" minOccurs="0"&gt;
     &lt;xsd:simpleType&gt;
        &lt;xsd:restriction base="xsd:string"&gt;
           &lt;xsd:maxLength value="12"/&gt;
        &lt;/xsd:restriction&gt;
     &lt;/xsd:simpleType&gt;
  &lt;/xsd:element&gt;
  </code></pre>
  
  <p>Currently create as:</p>
  
  <pre><code>String someString;
  </code></pre>
  
  <p>Basic setter and getter and the fancy fluent api, but nowhere is any restriction logic about the 12 characters</p>
  
  <p>Anyone would know how to generate with restrictions built in?</p>