Examples and usage of javadoc tags.
@author some-text |
To set the author. Javadoc will put this info at the end. |
@deprecated some-text |
To inform that something is deprecated. Better put at the beginning |
{@code some-text} |
Is the equivalent to <code>some-text</code>.
To insert code snippets in the comments. |
{@docRoot} |
To refer to the "root" of this javadoc. For
instance, to refer an image: <img src="{@docRoot}/some-image.png"> |
{@inheritDoc} |
To inherit the documentation from its nearest class. Useful
to copy more general comments from its parent classes and then
copy to is derivated classes. |
{@link package.class#member label} |
To create a link to another package, class, member. It
will show a link with the text of the "label". |
{@linkplain package.class#member label} |
The same as link, but the link will be shown with
normal font instead of code font. |
{@literal text} |
To include some text literally {@literal 3 < 5 > 7} will output:
{literal 3 < 5 > 7} |
@param parameter-name description |
To describe a parameter. Put it in a single line. |
@return description |
Adds a "Returns" section in the description, and is
used to better describe the return of some method. |
@see reference |
Adds a "See also" section in the description text. Forms
of reference may be:
- some-text - to refer to a book, for instance
- <a href="some-url">some-label</a> - to refer to a web page
- package.class#member label - to refer to another method or class
|
@serial |
|
@serialField |
|
@serialData |
|
@since since-text |
This adds a "since" section in the documentation, with the
specified since-text in it. |
@throws class-name description |
To indicate that this method trows a particular exception. |
{@value package.class#field} |
Use to refer to a value of a static field |
@version version-text |
To include a "version text" in the description. |