Using the Javadoc Comment dialog box, you can add or edit a documentation comment in your source code. Open the Javadoc Comment dialog box for a specific class by clicking its Javadoc property in the property inspector or by clicking Edit Comment in the Auto Comment Tool.
A Javadoc comment begins with the characters /**
, ends with the characters */
,
and consists of two parts: text and tags.
<B>
and <I>
) for formatting the description. Heading elements (such as <H1>
and <H2>
) are reserved for use by Javadoc. You can use the command buttons at the bottom of the dialog box
to include the HTML elements <B>
, <I>
,
<U>
, <CODE>
, and <PRE>
and the Javadoc
{@link}
in the description. For example:
/** * Returns the Class of this <I>Object</I>. * Java has a runtime representation for * classes--a descriptor of type Class-- * which the method getClass() returns for * any Object. */You do not need to type the characters
/**
and */
or the leading asterisks
in the the Javadoc Comment dialog box. These characters are automatically
included when you click OK and the IDE adds the comment to the source
code.
@
followed by a special keyword. Tags are case sensitive.
A Javadoc tag enables you to automatically generate information for the API documentation. For example,
@author
name adds an author entry with the specified
name to the generated documentation. A tag must appear
at the beginning of a line (otherwise it is treated as normal text). By convention, tags with the same name are grouped together. The following comment
includes four Javadoc tags:
/** * A class representing a screen window. * For example: * Window win = new Window(parent); * win.show(); * * @author Lynne Sim * @version 1.3 00/08/08 * @see java.awt.BaseWindow * @see java.awt.Button */
To add a Javadoc tag to your comment:
<B>
and <I>
)
and the inline Javadoc tag
{@link}
.
![]() |
To delete a tag from the list, select the tag and click Delete. |
![]() |
To change the order of the tags, select a tag and move it with the Move Up and Move Down buttons. |
http://java.sun.com/products/jdk/javadoc/writingdoccomments/index.html
.
For detailed information about Javadoc tags, see
http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/javadoc.html
.
See also | |
---|---|
Adding a Javadoc Comment to Source Code
Customizing the Output of Javadoc |