Selective javadoc

C

Chris

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?
 
L

Lew

Chris said:
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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,044
Members
48,769
Latest member
Clifft

Latest Threads

Top