users@jaxb.java.net

Re: generating Annotated classes with JAXB ?

From: Pierre Buyle <pierre.buyle_at_irislink.com>
Date: Wed, 28 Nov 2007 02:35:46 -0800 (PST)

You can use the <javacdoc> customization tag on your XSD type. Either
directly in your .xsd or in a separate binding file.

<xsd:schema jxb:version="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb">
  <xsd:complexType name="DeprecatedType">
    <xsd:annotation>
      <xsd:appinfo>
        <jxb:class>
          <jxb:javadoc>@deprecated</jxb:javadoc>
        </jxb:class>
      </xsd:appinfo>
    </xsd:annotation>
    <!-- Your type definition -->
  </xsd:complexType>
</xsd:schema>


Felipe Gaucho wrote:
>
> How can I generate annotated classes with JAXB ?
>
> I want to generate a class like that:
>
> @Deprecated
> public void MyClass {}
>
> @Deprecated is my primary goal, but I am also interested in figure out
> how to add any annotation to classes ? How to define it in the Schem
> or using customization...
>
>
> The reason I am looking for that: I am using JAXB as configuration
> framework of my application, and some of the configuration values
> should not be used anymore. In order to keep the compatibility with
> old configuration files, I don't want to rid off the declaration of
> the obsolete fields, but rather annotate it as deprecated.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
>

-- 
View this message in context: http://www.nabble.com/generating-Annotated-classes-with-JAXB---tf4887472.html#a13989622
Sent from the java.net - jaxb users mailing list archive at Nabble.com.