next up previous
Next: Disparities Up: Application Previous: A Retargetable Component Generator


A Retargetable javadoc

javadoc is a command-line tool that reads a .java source file and generates HTML documentation from the class declaration and stylized comments. By default, javadoc generates the documentation according to a predefined standard template, subject to limited user options. Indeed, early versions gave users little control over its operation. The parse tree was inaccessible, the abstract syntax was not revealed, and altering the tool's processing was not possible.

By JDK 1.2, javadoc had undergone two substantial design changes. First, the internal javadoc representation was exposed in a package called sun.tools.javadoc. Second, the format of the documentation became customizable. By running javadoc with the new command-line option -doclet SomeDocletTool (where SomeDocletTool.class is a user-supplied compiled class), the SomeDocletTool program may use the Doclet API to access the internal representation of the parsed file and to control how the parse tree is processed [28].

For documentation purposes, Sun provides the javadoc-generated HTML files for system classes but generally not their source code. If you don't have the source or the HTML files for a certain class, you cannot re-generate the documentation. Even if you have both the source and the HTML files, there is always uncertainty as to whether the versions you're using are consistent. Unfortunately, javadoc cannot rely on reflection to recover this information despite the functional similarity.

Figure: Grammarized reflection



Subsections
next up previous
Next: Disparities Up: Application Previous: A Retargetable Component Generator
David H. Lorenz 2003-02-17