Javadoc newbie - how to get "USE" content

I don't understand how to get content from the USE button. At the moment all my attempts produce a USE button which links to a page stating something like "No usage of root.package.class".

My current argument string for Javadoc is something like

-d c:\Doc -use C:\Source\

This doesn't work (produces a nice set of pages with the above problem on the "USE" page). To be specific there is no USE content even for two classes in the same package where one is used by the other.

I've tried guessing some longer combinations of terms leading up to:

-d c:\Doc -use -sourcepath C:\Source\ -classpath C:\Classes\ -subpackages root.packageA root.packageB C:\Source\*.java

though still to no avail. Please can someone offer some advice? Thanks very much

[790 byte] By [mildly_odda] at [2007-10-2 19:59:16]
# 1
Javadoc's definition of "use" is that the type appears in the *declaration* (not implementation) of another program element. Is that what you expect?The -use option should just work.
dhkramera at 2007-7-13 22:38:47 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2
Thanks for the prompt reply...Maybe I have misunderstood something - I had expected that it meant that if Class A contains a statement:import root.package.ClassBthen the USE link for ClassB will list Class A.Is this not the case?
mildly_odda at 2007-7-13 22:38:47 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3

No. Imports are considered by Javadoc to be part of the implementation. If you notice, javadoc does not document imports. Imports are completely ignored by Javadoc, other than to resolve names.

A "use" is where a type appears in a declaration, not an import or other implementation.

"Given class C, things that use class C would include subclasses of C, fields declared as C, methods that return C, and methods and constructors with parameters of type C."

http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#use

--

Example 1: Class A does *not* use class B:

import B;

public class A {

new B();

}

public class B {

}

--

Example 2: method getValue uses B:

public class A

void getValue(B b) {

}

}

public class B {

}

dhkramera at 2007-7-13 22:38:47 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 4
After all, import statements are entirely optional. Instead of importing java.util to access TreeMap, you could instead simply call java.util.TreeMap.
dhkramera at 2007-7-13 22:38:47 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 5

OK, thankyou, this has been helpful.

However, I'm still not there yet as I believe that several classes meet the "USE" criteria, e.g. have class field declarations such as

C c = new C(c);

And I note also the sentence from the same link:

"Note that this documents only uses of the API, not the implementation. If a method uses String in its implementation but does not take a string as an argument or return a string, that is not considered a "use" of String."

Which is interesting but I don't yet see how one could fall foul of this rule without having passed the criteria that you quoted to me.

Anyway, thankyou for your help todate - I need to think a little more on this to workout where I've gone wrong.

mildly_odda at 2007-7-13 22:38:47 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...