Java Reference
In-Depth Information
output. For this reason, I recommend applet writers use the
-d
directory
option to tell
javadoc where to put the generated files so you don't have them in the source directory; it
works the same as the same option on
javac
. Alternatively, you could use the filename ex-
tension
.htm
for the HTML page that invokes the applet.
See Also
Javadoc has numerous other command-line arguments. If documentation is for your own use
only and will not be distributed, you can use the
-link
option to tell it where your standard
JDK documentation is installed so that links can be generated to standard Java classes (like
String
,
Object
, and so on). If documentation is to be distributed, you can omit
-link
or use
-link
with a URL to the appropriate Java API page on Oracle's website. See the online tools
documentation for all the command-line options.
The output that javadoc generates is fine for most purposes. It is possible to write your own
Doclet
class to make the javadoc program into a class documentation verifier, a Java-to-MIF
or Java-to-RTF documentation generator, or whatever you like. Those are actual examples;
see the javadoc tools documentation that comes with the JDK for documents and examples,
or go to
Oracle's website
.
Visit
Doclet
for a somewhat dated but useful collection of Doclets
and other javadoc-based tools.
Javadoc Versus JavaHelp
Javadoc is for programmers using your classes; for a GUI application, end users will prob-
ably appreciate standard online help. This is the role of the Java Help API, which is not
covered in this topic but is fully explained in
Creating Effective JavaHelp
(O'Reilly), which
every GUI application developer should read. JavaHelp is another useful specification that
was somewhat left to coast during the Sun sellout to Oracle; it is now hosted on
java.net
at
Beyond Javadoc: Annotations/Metadata
Problem
You want to generate not just documentation, but also other code artifacts, from your source
code. You want to mark code for additional compiler verification.