aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Javadoc and Inner classes Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Javadoc and Inner classes Problem" Watch "Javadoc and Inner classes Problem" New topic
Author

Javadoc and Inner classes Problem

jay denzel
Ranch Hand

Joined: Sep 18, 2002
Posts: 57
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
Stephane Weber
Ranch Hand

Joined: Mar 07, 2002
Posts: 110
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

Joined: Sep 18, 2002
Posts: 57
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

Joined: Sep 18, 2002
Posts: 57
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

Joined: Mar 07, 2002
Posts: 110
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

Joined: Sep 18, 2002
Posts: 57
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

Joined: Sep 18, 2002
Posts: 57
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javadoc and Inner classes Problem