Javadoc
is a Java tool that generates API reference documentation automatically from properly
formatted, in-line documentation.
JavaDoc assembles its documentation by collecting appropriately formatted comments in your code. You can document classes, instance variables and methods using the standard following format illustrated here:
package edu.calvin.cs108;
/** Container.java computes the volume and surface area of cylinders.
*
* @author Keith Vander Linden
* @version 19june2006
*/
public class Container {
/**
* computeVolume computes the volume of a cylinder given common units.
*
* @param diameter The non-negative diameter of the cylinder
* @param height The non-negative height of the cylinder
* @return volume of the cylinder
* @see Container#computeArea
*/
public static double computeVolume(double diameter, double height) {
return Math.PI * Math.pow(diameter / 2, 2) * height;
}
// other methods and documentation...
}
Some Java IDEs, including Eclipse, will automatically format your JavaDoc comments if you
type /** and then hit enter just before your class or method definition.
You can get Eclipse to generate JavaDoc-formatted documentation as follows:
~/workspace/processing/doc).This should create a new doc package in your Eclipse workspace in the location
specified above.
JavaDoc produces its documentation as a set of HTML-formated API reference documents, which can be viewed using a standard web browser. You can use Eclipse's built-in web-browser to view this documentation as follows:
index.html file, the main API
documentation file in the doc folder.A web-browser-like window will open (either as a separate window or directly in Eclipse, depending upon how your Eclipse environment is configured). Use this browser to navigate around the API documentation structure.