The Java Documentation Tool: javadocThe javadoc tool parses the declarations and documentation comments in a Java source file and generates a set of HTML pages that describes the following elements: public and protected classes, inner classes, interfaces, constructors, methods, and fields. The javadoc tool can be used on a single file or an entire package of files. Recall that a Java documentation comment is one that begins with /** and ends with */. These are the comments that are parsed by javadoc. The javadoc tool has many features, and it is possible to use Java doclets to customize your documentation. For full details on using the tool, it is best to consult Sun's Web site. To illustrate how it might be used, let's just look at a simple example. The FirstApplet program from Chapter 1 contains documentation comments. It was processed using the following command: javadoc FirstApplet.java javadoc generated the following HTML documents: FirstApplet.html -The main documentation file allclasses-frame.html -Names and links to all the classes used in FirstApplet overview-tree.html -A tree showing FirstApplet's place in the class hierarchy packages.html -Details on the packages used in FirstApplet index.html -Top-level HTML document for FirstApplet documentation index-all.html -Summary of all methods and variables in FirstApplet To see how the documentation appears, review the FirstApplet.java source file and the documentation it generated. Both are available at: http://www.prenhall.com/morelli/ |