File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Javadoc and nested classes? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Javadoc and nested classes?" Watch "Javadoc and nested classes?" New topic

Javadoc and nested classes?

Robert Konigsberg
Ranch Hand

Joined: Jun 23, 2004
Posts: 172
How can I get javadoc to include documentation for nested classes? I want to have a nested class documented, even though its implementation is not available.

In other words:

class A{
public B _b;

class B

Since _b is a public member of B there's good reason to document the B interface in javadoc. You see?



SCJP 1.4 (91%)<br />SCJD 1.4 (376/400, 94%)
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
I've never noticed what javadoc spits out for nested classes ... but the documentation indicates that it supports nested classes. I imagine that you're not specifying that it should document all members, including the "default" visibility ones (your nested class). I'd check out the tools documentation and see if you need to specify some additional parameters and see how it goes.

Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
My idia is declare another interface which is inner class B implements,the _b variable refer to that interface like this:

You can document this interface C instead of the inner class B.
[ July 02, 2004: Message edited by: Surasak Leenapongpanit ]
I agree. Here's the link:
subject: Javadoc and nested classes?
jQuery in Action, 3rd edition