users@jaxb.java.net

Customization namespaces and "vendor extensions"

From: Rune Peter Bjørnstad <runepeter_at_online.no>
Date: Sun, 16 Jan 2005 20:05:11 +0100

I’m currently investigating how to create a JAXB ”vendor extension”. I’ve
had great help from looking at HyperJAXB source code and I’m currently able
to support the following XML Schema annotation:

 

<xsd:complexType name=”Test”>

  <xsd:sequence>

    <xsd:element name=”test” type=”xsd:string”>

      <xsd:annotation>

        <xsd:appinfo>

          <jaxb:property>

            <jaxb:javadoc>

              @java.type=java.io.File

              @verify.file.exists=true

            </jaxb:javadoc>

          </jaxb:property>

        </xsd:appinfo>

      </xsd:annotation>

    </xsd:element>

  </xsd:sequence>

</xsd:complexType>

 

By accessing a generated classes JavaDoc, and parsing it using my “vendor
extension”, I’m able to generate classes that adapts to my needs. This is
all fine and dandy, but I’m currently investigating how this can be done
more elegantly. The following XML Schema annotation is the notation I would
like to be able to use:

 

<xsd:complexType name=”Test”>

  <xsd:sequence>

    <xsd:element name=”test” type=”xsd:string”>

      <xsd:annotation>

        <xsd:appinfo>

          <myns:javaType class=”java.io.File”>

            </myns:verifyExistence />

          </myns:javaType>

        </xsd:appinfo>

      </xsd:annotation>

    </xsd:element>

  </xsd:sequence>

</xsd:complexType>

 

Does to the JAXB RI provide “hooks” for providing vendor customization
namespaces, which can be use din order to customize class creation? The
example above is just used to demonstrate what I would like to do. I am
aware that the result can be achieved using current RI customization
features, but this is not the object of my question.

 

Kind Regards,

 

Rune Peter Bjørnstad.