users@jaxb.java.net

Re: schemagen and xsd documentation annotations

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 10 Jul 2007 12:33:03 -0700

James.Strachan wrote:
> Great stuff! I've just hit a similar requirement; wanting auto-creation of
> the XSD documentation annotations from the Java code, so i'd love a solution
> to 369 - will see if I can find some time to help after my upcoming
> vacation...

That would be great.

> I guess my ideal solution would be; use the JavaDoc comments from the class
> / field / property setter (usually the setter describes the effect of
> changing a value along with its possible valid values so often its better
> documentation for the schema than the getter; also for some Spring POJOs
> there only is a setter).
>
> However sometimes you might wanna write some custom documentation just for
> the XSD which differs from the usual javadoc - so I like the idea of using
> an annotation such as @XmlDocumentation on a class, field or setter to
> replace the javadoc.
>
> i.e. for most things the javadoc will be totally fine; for those places
> where its not, use @XmlDocumentation. If some folks wanna use
> @XmlDocumentation on every class/field/setter thats cool too.
>
> Incidentally given that this annotation is only gonna be used by the
> schemagen tool, its no biggie if its an RI specific extension annotation.

Agreed on all points.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com