Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Selective javadoc (http://www.velocityreviews.com/forums/t597255-selective-javadoc.html)

Chris 03-09-2008 08:14 PM

Selective javadoc
 
We publish a library. Part of the API we'd like to document, and part of
it needs to remain closed.

I'd love to be able to put a tag in the Javadoc for a class that would
tell the Javadoc tool to generate the javadoc or not. It would also be
nice to include/exclude specific methods.

I can find nothing in the Javadoc docs that supports this. I'm wondering
if there is a fancy doclet out there that would do it?

Lew 03-09-2008 10:26 PM

Re: Selective javadoc
 
Chris wrote:
> We publish a library. Part of the API we'd like to document, and part of
> it needs to remain closed.
>
> I'd love to be able to put a tag in the Javadoc for a class that would
> tell the Javadoc tool to generate the javadoc or not. It would also be
> nice to include/exclude specific methods.
>
> I can find nothing in the Javadoc docs that supports this. I'm wondering
> if there is a fancy doclet out there that would do it?


$ javadoc -help
usage: javadoc [options] [packagenames] [sourcefiles] [@files]
...
-sourcepath <pathlist> Specify where to find source files
...
-exclude <pkglist> Specify a list of packages to exclude
...

Also, javadoc will exclude package-private classes by default. It's good
design anyway to keep such classes package-private and link them via an
accessible interface.

Same reasoning for methods - keep methods you don't want documented at private
or package-private access.

By judiciously combining inclusive parameters with exclusionary options one
can control javadoc pretty finely.

For a terse but complete description of the options, see
$ man javadoc

Even more at
<http://java.sun.com/javase/6/docs/technotes/tools/solaris/javadoc.html>
<http://java.sun.com/javase/6/docs/technotes/tools/windows/javadoc.html>

--
Lew


All times are GMT. The time now is 06:45 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.