• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JavaDoc Question

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers

My assignment tells me to 'Javadoc' every element of the public interface of each class.

In the code snippet below I create an annonymous class (new WindowAdapter) containing the public method windowClosing (which is specified by the interface WindowListener)

My question is as follows:
Do I have to add a Javadoc comment for "public void windowClosing(WindowEvent we)" or is it legal to omit the Javadoc comment?



Thanks for any answers.
Cheers Stef
[ August 25, 2004: Message edited by: Stef Widmer ]
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stef,

My question is as follows:
Do I have to add a Javadoc comment for "public void windowClosing(WindowEvent we)" or is it legal to omit the Javadoc comment?


No. You don't need to javadoc anonymous inner classes. Matter of fact, I think you even can't.
Anonymous inner classes are local to the methods, hence they are not available to anyone else, even to the methods in the same class. Think about it, what is the use of the documentaion if no one else can use it...!!
[ August 25, 2004: Message edited by: Hanna Habashy ]
 
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually this question is better asked regardless of any annoymous factor.

If an inner class is not public or protected then the default javadoc visibilty argument will not show your inner class in the docs.

I have inner classes that implement interfaces, so there method signatures are public. The interface is documented, but I haven't even written a comment of any kind against the implementations, since they are self documenting. The inner class is private and only the interface type is made visible to clients via a factory method which is well documented.
 
Stef Widmer
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ranchers, I felt so too (a little bit), but it's good to have other optinions to get the feeling I'm doing it right.

Thanks all...
Cheers Stef
[ August 25, 2004: Message edited by: Stef Widmer ]
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello everyone:
what kind of classes are need to write javadoc comment in my application?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic