• 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 and Inner classes Problem

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a problem generating by Javadoc files. I have a class which creates my application window. Inside this class I have a couple of inner classes. My problem is that if I run javadoc over my suncertify.gui package my inner classes will not appear in the generated HTML. I commented the inner classes correctly like every other class.
Has anybody a clue what I am missing? I searched the sun documentation about javadoc but did not find anything.
Normally the inner classes sould be included in the HTML.
Please advice. Thanks.
Greets.
jay
-------
SCJP2
 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
If you are talking about anonymous inner classes, this paragraph is to be found in the Javadoc HOWTO from SUN:


Documenting Anonymous Inner Classes
Anonymous inner classes are defined in Java Language Specification, Second Edition, at Anonymous Class Declaration. The Javadoc tool does not directly document anonymous classes -- that is, their declarations and doc comments are ignored. If you want to document an anonymous class, the proper way to do so is in a doc comment of its outer class, or another closely associated class.
For example, if you had an anonymous TreeSelectionListener inner class in a method makeTree that returns a JTree object that users of this class might want to override, you could document in the method comment that the returned JTree has a TreeSelectionListener attached to it:
/**
* The method used for creating the tree. Any structural modifications
* to the display of the Jtree should be done by overriding this method.
* This method adds an anonymous TreeSelectionListener to the returned JTree.
* Upon receiving TreeSelectionEvents, this listener calls refresh with
* the selected node as a parameter.
*/
public JTree makeTree(AreaInfo ai){
}


But I don't think we have to document those as they are invisible to the user of the class anyway.
Thanks to tell me if I am right ...
Stephane
 
jay denzel
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi stephane,
no I do not mean anonymous inner classes. Something like
public class MainClass {
class InnerClass {
}
}
If you look into the SUN API HTML docs their inner classes are all documented inside the HTML. But if I try to generate them every inner class is left out. What can I do?
Thanks for your help.
jay
------
SCJP2
 
jay denzel
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
GOT IT!!!
You have to use -private on the command line, that will do the trick.
Thanks for your effort anyway.
Greeting.
jay
 
Stephane Weber
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry not to have been more helpful
And thanks for the tip anyway ...
Stephane
P.S. Anyway, this made me start wondering ... Can you confirm (it seemed obvious for me, but now I doubt ) that anonymous inner classes should not be 'Javadoc-ed' ? Anyway I wouldn't see how.
I see that Javadoc indeed creates files like FBNClient$1 ... but without comments. Is there a way to make these not appear in the doc ?
 
jay denzel
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually if I use something like this:
javadoc -private ...
The anonymous inner classes to NOT appear in my generated HTML docs.
Sorry can't help you with this one
greets
jay
 
jay denzel
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually if I use something like this:
javadoc -private ...
The anonymous inner classes to NOT appear in my generated HTML docs.
Sorry can't help you with this one
greets
jay
reply
    Bookmark Topic Watch Topic
  • New Topic