Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

do public ActionListener classes/actionPerformed() methods need Javadocs?

 
Ramses Tutoli
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
strictly following the guidelines, I guess they do..but what do you guys think?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd say yes, they do. Which is a good incentive to make such classes non-public. The methods have to be public, because all interface methods are public, but if the implementing class is itself private, or a local or anonymous class, it doesn't matter what its methods are like, it won't appear in javadoc. Which is usually what I'd prefer, unless the listener is really supposed to be used by other classes. Listeners are probably the main reason anonymous classes were invented in the first place.
If your listener is package-level (either a standalone or nesteed class) thien I'm not so sure. When you generate your javadoc you get to choose what level of access is documented. The default is protected and public are documented, not package. You may want to document package too, for those times you were forced to make something package rather than private. If you set javadoc to document package methods & classes, then you should provide javadoc for all package methods and classes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic