The javadoc Tool (Documentation Generator)

   

The javadoc Tool (Documentation Generator)

The javadoc tool creates an HTML file based on the tags that are embedded in the /** */ type of comments within a Java source file. These HTML files are used to store information about the classes and methods that you can easily view with any Web browser.

Here is the format of the javadoc command:

 javadoc [options] [ packagenames ] [sourcefiles] [classnames] [@files] 

javadoc was actually used by the creators of the SDK to create the Java API Documentation. The javadoc homepage can be found at

 http://java.sun.com/products/jdk/javadoc/index.html 

Many options can be used by the javadoc command. Tables B.4 and B.5 attempt to describe the most important options. For a complete list, type javadoc on the command line.

Table B.4. javadoc Options
Option Description
-verbose Outputs message about what javadoc is doing.
-d directory Specifies the directory where javadoc stores the generated HTML files. For example, javadoc -d C:\ usrs\ dac\ public_html\ doc java.lang .
-classpath <pathlist> Looks for class files within the specified directories or JAR files.. For multiple directories, a colon (UNIX) or semicolon (DOS) is used to separate each directory. For example, on a DOS machine, the CLASSPATH might look like set CLASSPATH=.;C:\ users\ dac\ classes;C:\ tools\ java\ classes .
-sourcefile <pathlist> Specifies in colon-separated directories the list of files to use.
-nodeprecated Causes javadoc to ignore @depreciated paragraphs.
-author Causes javadoc to use the @author paragraphs.
-noindex Causes javadoc not to create an index file.
-notree Causes javadoc not to create a tree file.
Table B.5. javadoc Tags
Tag Description
@see class Puts a See Also link in the HTML file to the class specified by class .
@see class#method Puts a See Also link in the HTML file to the method specified by method .
@param param descr Describes method arguments.
@version ver Specifies the version of the program.
@author name Includes the author's name in the HTML file.
@return descr Describes a method's return value.
@exception class Creates a link to the exceptions thrown by the class specified by class .
   


Special Edition Using Java 2 Standard Edition
Special Edition Using Java 2, Standard Edition (Special Edition Using...)
ISBN: 0789724685
EAN: 2147483647
Year: 1999
Pages: 353

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net