The Stat Data Provider Inc. development team scours their code and frantically attempts to piece together a development guide. Unfortunately, they have forgotten the details of how certain portions work. The Javadoc(TM) tool can deter such a situation from showing its ugly face. In this article, the reader is guided through self-documenting code in a structured manner to generate Java(TM) API documentation.
Using Javadoc - A Sample Class with Some Comments (Page 3 of 5 )
We have provided a sample Java class that incorporates a number of the tags listed above. Download the sample code here and take a few minutes to examine its contents.
Creating Documentation in HTML Format
Generate the Java documentation for the sample class by executing the command in listing 2A. The first two options, “-author –version”, instruct the javadoc tool to respect the @author & @version tags. Otherwise, javadoc will ignore these tags during document creation. The last option, “-d c:documentation”, informs javadoc to generate the documents to the specified directory.
Listing 2A: Generate documentation through the Javadoc tool