title: how to force schema compiled classes to extend specific class outside schema
body: <p>Need help with following situation:
  Users can generate their own data structures which are stored as JAXB-ready XSD sources like below:</p>
  
  <pre><code>&lt;xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  
    &lt;xs:element name="Group" type="Group"/&gt;
    &lt;xs:element name="Parameter" type="Parameter"/&gt;
  
    &lt;xs:complexType name="Group"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="caption" type="xs:string" minOccurs="0"/&gt;
        &lt;xs:element name="parameters" type="Parameter" nillable="true" minOccurs="0" maxOccurs="unbounded"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  
    &lt;xs:complexType name="Parameter"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="key" type="xs:string" minOccurs="0"/&gt;
        &lt;xs:element name="group" type="Group" minOccurs="0"/&gt;
        &lt;xs:element name="value" type="xs:string" minOccurs="0"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>After new or modified schema appears it is automatically parsed by Schema compiler, java sources being generated, compiled and packaged into user jars:</p>
  
  <pre><code>  SchemaCompiler sc = XJC.createSchemaCompiler();
    // Input source for schema
    InputSource is = new InputSource(new StringInputStream(objectPackage.getObjectSchema()));
    // Parse
    sc.parseSchema(is);
    S2JJAXBModel model = sc.bind();
    // Generate source
    JCodeModel jCodeModel = model.generateCode(null, null);
    jCodeModel.build(packageSourceDirectory);
    // Compile and package 
    // ......
  </code></pre>
  
  <p>And everything was ok until it was decided that all user-generated classes must extend one specific known class, say <code>UserRootObject</code>:</p>
  
  <pre><code>package user.abc;
  public class Group extends com.mycompany.xml.UserRootObject {
    //
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>package user.abc;
  public class Parameter extends com.mycompany.xml.UserRootObject {
    //
  }
  </code></pre>
  
  <p>Everything is on the fly, I can not force users to modify their schema files but I can transform them prior to code generation. 
  Looks like I have two options to introduce that <code>UserRootObject</code>: somehow via <code>JCodeModel</code> or somehow transforming schema files before building Java sources.</p>