users@jaxb.java.net

RE: Re: Re: generate javadoc

From: Dave Hoffer <DHoffer_at_xrite.com>
Date: Sun, 30 Dec 2007 13:58:32 -0500

Regarding having to include the java source to see the javadocs; this is not a JAXB issue but rather a build issue. We use maven to create separate jars of classes, javadocs & sources which then are used by our IDE. Your build system ought to be able to do something similar.

As for the <jaxb:javadoc> of the complex type, I understand this works for you. It did for me too but I did not find it useful because, as I was saying, it replaces the documentation that comes from the regular xsd docs, i.e. <xs:documentation>. Since we generate C++ binding as well as java & NET I can't loose one documentation just to gain another.

Why <jaxb:javadoc> is not working on the attribute I am not completely sure. I think you have to tell jaxb what type this is like you did for the complexType, i.e. <jaxb:class>. However since this is an attribute not a class I'm not sure what the type jaxb wants, you might try <jaxb:property> or something like that. I would love to see some ref docs on what is valid here. However, I did get this to work at one point but here too I did not find it useful because it put the docs on only one part of the setter/getter combination. I don't recall which method had the javadocs; so here it replaced the default docs with my custom docs but only for one of the two methods (not counting the isSet and unset methods...it does nothing here also). Additionally my main complaint here with JAXB is that it completely ignores my regular xsd docs, i.e <xs:documentation>. (If you know how to fix this please let me know.)

I was wondering if it is possible to write a plugin that could do this right. However I don't know what xsd documentation is preserved by the xjc processer and passed to the plugin API. We have written several jaxb plugins that fix up fixed values, create constructor factories of sorts, etc.

-Dave

-----Original Message-----
From: Felipe Gaścho [mailto:fgaucho_at_gmail.com]
Sent: Sunday, December 30, 2007 6:41 AM
To: users_at_jaxb.dev.java.net
Subject: Re: Re: generate javadoc

example:

        <xsd:complexType name="ConfigPdfTemplate">
                <xsd:annotation><xsd:appinfo><jaxb:class>
                                        <jaxb:javadoc>
                                                <![CDATA[ This comment works fine... ]]>
                                        </jaxb:javadoc>
                                </jaxb:class></xsd:appinfo>
                </xsd:annotation>
                <xsd:attribute name="pdf.template.filename" type="xsd:string">
                        <xsd:annotation>
                                <xsd:appinfo>
                                        <jaxb:javadoc>
                                                <![CDATA[ I want to comment this...]]>
                                        </jaxb:javadoc>
                                </xsd:appinfo>
                        </xsd:annotation>
                </xsd:attribute>

Should I create a different type based on String just to include the
documentation ??


On Dec 30, 2007 12:19 PM, Felipe Gaścho <fgaucho_at_gmail.com> wrote:
> ok, my steps now:
>
> 1) create the schema
> 2) generate the classes
> 3) pack the JAR file for distribution
>
> if I include the java files in the JAR, the developers can see the javadoc.
>
> Is there a way to include the javadoc in the JAR file without the need
> to include the java files ? Does it make sense ?
>
>
>
> On Dec 29, 2007 9:52 PM, Felipe Gaścho <fgaucho_at_gmail.com> wrote:
> > > What do you mean by "and I want to know how to define that "Possible values" in the getter/setter methods...."?
> >
> > if you don't change anything and do generate the classes, the javadoc
> > of the getters and setters methods include a partial message "possible
> > value".. I was looking for a way to include the values, like: "number
> > of trains or null..."
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net