UP | HOME

Using Java Documentation Tool Javadoc

Javadoc generates html pages as documentation. See http://en.wikipedia.org/wiki/Javadoc

Why

To ensure consitent and up-to-date documentation.

How

Documentation is included as comments in the source code (Java classes). It is common to document interfaces, classes and members (variables, methods).

Avoid stating the obvious, e.g. adding name of customer as comment to the field name in class customer.

Action

Run Javadoc with sources in .classpath. From within Eclipse select from the main menue: Project -> Generate Javadoc. You can customize formatting using Window -> Preferences (or project properties).

Usage

To do documentation use annotations within comments. Eclipse generates templates in your class file. Opening a comment directly above an interface, class or member declaration using =/**</code> (followed by a newline) adds the obvious annotations. Examples are

/**
* @author      
* @version     
* @param       (methods and constructors only)
* @return      (methods only)
* @exception   (@throws is a synonym added in Javadoc 1.2)
* @see         (e.g. @see #field references member of the same class)
* @since       
* @serial      
* @deprecated  
*/ 

See http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html?ssSourceSiteId=otncn#examples

Author: Rainer Schuler

Date: 2011-02-11 Fr

HTML generated by org-mode 7.4 in emacs 22