Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disabling Javadoc for Methods

 
Jay Damon
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a common problem - see http://www.martinfowler.com/ieeeSoftware/published.pdf

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic