×
Namespaces

Variants
Actions

JavaDoc

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: senthilkumar05 (12 Dec 2007)
Last edited: hamishwillee (29 Jul 2013)

JavaDoc The JavadocTM tool parses the declarations and documentation comments in a set of Java source files and produces a corresponding set of HTML pages describing (by default) the public and protected classes, nested classes, interfaces, constructors, methods, and fields. You can use it to generate the API (Application Programming Interface) documentation or the implementation documentation for a set of source files.

SYNOPSIS

javadoc [ options ] [ packagenames ] [ sourcefilenames ] [ -subpackages pkg1:pkg2:... ] [ @argfiles ]

Arguments can be in any order.

options -         Command-line options
packagenames - A series of names of packages, separated by spaces, such as java.lang java.lang.reflect java.awt.
use -subpackages for recursion. The Javadoc tool uses -sourcepath to look for these package names.
sourcefilenames - A series of source file names, separated by spaces, each of which can begin with a path and contain a wildcard such as asterisk (*).

Class and Interface Documentation Tags

@see
@since
@deprecated
@serial
@author
@version
{@link}
{@linkplain}
{@docRoot}

An example of a class comment:

/**
* A class representing a window on the screen.
* For example:
*
* @author Senthil
* @version 1.0
* @see java.awt.BaseWindow
* @see java.awt.Button
*/
class Window extends BaseWindow {
...
}

Field Documentation Tags The following are the tags that can appear in the documentation comment for a field.

Field Tags

@see
@since
@deprecated
@serial
@serialField

An example of a field comment:

   /**
    * The z-coordinate of the component.
    *
    * @see #getLocation()
    */
   int z = 1732;

Method/Constructor Tags

@see
@since
@deprecated
@param
@return
@throws and @exception
@serialData
{@link}
{@linkplain}
{@inheritDoc}
{@docRoot}

Example

/**
* Returns an Image object that can then be painted on the screen.
* The url argument must specify an absolute {@link URL}. The name
* argument is a specifier that is relative to the url argument.
* <p>
*
* @param url an absolute URL giving the base location of the image
* @param name the location of the image, relative to the url argument
* @return the image at the specified URL
* @see Image
*/
public Image getImage(URL url, String name) {
try {
return getImage(new URL(url, name));
} catch (MalformedURLException e) {
return null;
}
}
This page was last modified on 29 July 2013, at 04:20.
43 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×