users@jaxb.java.net

Can I apply bindings to included schemas?

From: <peter.follo+javadev_at_foi.se>
Date: Wed, 27 Jun 2012 11:37:44 +0000 (GMT)

If one wants to annotate every 'complexType' in the generated code with
say a 'SuppressWarnings' annotation one could use a binding file
looking something like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:annox="http://annox.dev.java.net"
    xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb
http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
    jaxb:extensionBindingPrefixes="xjc annox"
    version="2.1">
  
  <jaxb:bindings
schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gmlBase.xsd"
node="/xs:schema" >
    <jaxb:bindings node="xs:complexType" multiple="true"
required="false">
        <annox:annotate>
          <annox:annotate annox:class="java.lang.SuppressWarnings"
value="unused"/>
        </annox:annotate>
    </jaxb:bindings>
  </jaxb:bindings>

</jaxb:bindings>

And it works all fine :-)

However, if the schema imports other schemas, such as
http://schemas.opengis.net/citygml/profiles/base/1.0/CityGML.xsd do,
this binding rule won't traverse recursively to the imported schemas.
Is there a way to make this rule traverse imported schemas? Can I use
some sort of global binding instead? Can I use some kind of wildcard as
a value to schemaLocation? Ideas anyone?