title: XJC Generating Integer Instead of int
body: <p>The following schema should be generating two primitive <code>int</code> fields in a <code>Value</code> class, but instead generates a primitive <code>int</code> for the <strong>element</strong> and <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Integer.html" rel="noreferrer">java.lang.Integer</a> for the <strong>attribute</strong>.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;xsd:schema version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://www.example.com/test" xmlns:test="http://www.example.com/test"
      elementFormDefault="qualified"&gt;
  
      &lt;xsd:element name="values"&gt;
          &lt;xsd:complexType&gt;
              &lt;xsd:sequence minOccurs="0" maxOccurs="unbounded"&gt;
                  &lt;xsd:element ref="test:value" /&gt;
              &lt;/xsd:sequence&gt;
          &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
  
      &lt;xsd:element name="value"&gt;
          &lt;xsd:complexType&gt;
              &lt;xsd:sequence&gt;
                  &lt;!-- Is generated as primitive int --&gt;
                  &lt;xsd:element name="element" type="xsd:int" /&gt;
              &lt;/xsd:sequence&gt;
              &lt;!-- Is generated as java.lang.Integer --&gt;
              &lt;xsd:attribute name="attribute" type="xsd:int" /&gt;
          &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
  
  &lt;/xsd:schema&gt;
  </code></pre>
  
  <p>I've looked through the <a href="http://jaxb.java.net/guide/" rel="noreferrer">JAXB documentation</a> for anything that says that attributes and elements may be generated differently and found nothing.</p>
  
  <p>Can anyone explain this? Is there a fix to make the attribute generate as a primitive <code>int</code>?</p>