display | more...
Javadoc is a really useful tool supplied with Sun's Java Development Kit. It provides a very easy way of making the (very dull) task of documenting your Java code slightly easier. Any class or method can have a special /**     */ comment before it. Then the javadoc tool is run against the commented source code. API documentation (complete with class hierarchy and method index) are created in HTML.

/** Adds two numbers together.
 * @param first the first number to add.
 * @param second the second number to add.
 * @return the sum of the two integers
 */
public int addNumbers(int first, int second)
{
   return first + second;
}
Other flags you can use include:
  • @see
  • @version
  • @author
  • @exception
  • @deprecated
Some people like the javadoc supplied with JDK1.2 because is generates the documentation using frames (plus it's all blue and pretty too). Others prefer the more simple output from the JDK1.1 version.

See http://java.sun.com/products/jdk/javadoc/ for more info.

There are plans by The Apache Jakarta Project to petition Sun to release the source code for their javadoc utility to the open source community. The current javadoc, while extremely useful for documentation, is clunky, slow and is incompatible with XML and other applications.

See http://relativity.yi.org/WebSite/opensource-javadoc/ for details.

Log in or register to write something here or to contact authors.