Comp201: Principles of Object-Oriented Programming I
Spring 2005 -- JavaDocs   


The Java Development Kit (JDK) comes with a tool called JavaDoc.  This tool will generate documentation for Java source code with comments written in accordance with the Java documentation style.   The following links show more examples.  You do need to spend time outside of the lab to study them.

Click here to download a zip file (listSource.zip) containing sample Java code into your own directory.  It includes Java source code for a version of lists discussed in the past few lectures. 

Use DrJava to look at both the code and the comments, which follow the JavaDocconventions.  The following is a very short summary of the JavaDoc conventions.

Creating JavaDocs using DrJava:

In DrJava, 

Now change the JavaDoc Access Level in the Javadoc Preferences to private and generate JavaDoc again.  What is  the difference?

Creating javadoc (1.1 version) using StructureBuilder

In the class properties dialog boxes, where one can specify various aspects of a class, there are also tabs for adding comments for the class itself, for variables (fields) and for methods, including their parameters and return values.  

You can generate JavaDoc using the Tools/Generate Documentation menu in StructureBuilder.  What you get is the UML class diagram diagram together with the JavaDoc (version 1.1 style).  You may use this tool to generate JavaDoc and UML diagrams for all of the assignments.

See the page on Generating Documentation in StructureBuilder in the Java Resources web site for more detailed information.

 


Last Revised Thursday, 03-Jun-2010 09:50:08 CDT

©2005 Stephen Wong and Dung Nguyen