File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Disabling Javadoc for Methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Disabling Javadoc for Methods" Watch "Disabling Javadoc for Methods" New topic

Disabling Javadoc for Methods

Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
Is there any way to disable the generation of Javadoc for a specific class method? I have some protected methods in a class that I would rather not be part of the "published" API but the methods must have protected access because the class is subclassed in another package. I don't see one but I was wondering if there was a tag that would allow me to specify that generation of Javadoc should be disabled for these methods. Not generating Javadoc for protected methods is not feasible as there are a number of protected methods that should be "published".
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

perhaps in conjunction with annotations?

Why not mention your intention in the docs itself?

If a developer finds out, that there are undocumented methods, he might think the documentation is out of sync - if you tell him, not to access method x directly, it's his fault if he does.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Just thinkin out loud ... don't hurt me if this is dumb ... Any chance to add a layer of inheritance ... put your double secret methods in a base class in a package that you omit from JavaDoc entirely, extend those classes in a with the methods people should see documented package?

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
This is a common problem - see

We wrote our own doclet that recognizes @published tags. In fact we wrote two: one that simply marks published members, and one that filters so that only published members are shown.

Lately we've begun to try a different approach, though: we've put the published API into its own module, mostly consisting of interfaces and factories. The actual implementation is placed into a different module and can add as many methods as needed.

In my opinion the latter works better. Only drawback is that in the implementation we sometimes need to cast from a published interface to an actual implementation to call a non-published method internally.

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I agree. Here's the link:
subject: Disabling Javadoc for Methods
jQuery in Action, 3rd edition