Java Reference
In-Depth Information
Table 2-7. Constructor and Method Tags
Tag
Description
@param
Describes a parameter in the method signature. Each
parameter should be described on its own line, with the list
following the same order as the parameters in the method
signature.
@return
Describes the value or object returned from the method.
@exception
Describes an exception that may be thrown from this method.
( @throws is a synonym added in Javadoc 1.2.)
@see
Generates a link to the specified class, method, or field—the
link will appear in a special “See Also” section of the generated
Javadoc.
@since
Used to indicate the version number of your package in which
this constructor or method first appeared.
@deprecated
Used to indicate that a constructor or method should no
longer be used but still exists for compatibility reasons. The
tag should be followed by text indicating what constructor
or method the user should use instead of this constructor or
method, or “No replacement” if there is no constructor or
method with replacement functionality.
{@link reference label }
Generates an inline link to the specified class, method, or
field. The label will appear in monospaced font.
{@linkplain reference label }
Same as the {@link} tag except that the label will appear in
standard font.
{@docRoot}
Points to the base directory (where the index.html file
resides) for your generated Javadoc. This will be correct
no matter how many directories deep this tag is used.
The @see and @link tags will create hyperlinks to the first matching class, field, or method.
The class name does not need to be specified when referring to a method or field within the
current class; likewise, the package name does not need to be specified when referring to a
class within the same package. Finally, unless you want to refer to a specific overloaded
method, you do not need to specify the method parameters. Some examples are shown in
Table 2-8.
Table 2-8. Examples of @see Links
Example
Comment
@see #field label
Creates a link to the specified field with the given label
@see #method label
Creates a link to the first matching method and gives the
link the specified label
@see #method (parameters) label
Creates a link to the method with the matching signature
and gives the link the specified label
@see class#method label
Creates a link to the first matching method in the named
class and gives the link the specified label
@see package.class#method label
Creates a link to the first matching method in the named
class in the named packages and gives the link the speci-
fied label
Search WWH ::




Custom Search