javadoc标签
2021-05-12 23:28
标签:文档 range cat method ber cti dep rod sdk The current tags are Package Documentation Tags Class and Interface Documentation Tags Field Documentation Tags Constructor and Method Documentation Tags 参考文档 javadoc标签 标签:文档 range cat method ber cti dep rod sdk 原文地址:https://www.cnblogs.com/leizhi/p/13137560.htmljavadoc标签
Tag Introduced in JDK/SDK
@author 1.0
{@code} 1.5
{@docRoot} 1.3
@deprecated 1.0
@exception 1.0
{@inheritDoc} 1.4
{@link} 1.2
{@linkplain} 1.4
{@literal} 1.5
@param 1.0
@return 1.0
@see 1.0
@serial 1.2
@serialData 1.2
@serialField 1.2
@since 1.1
@throws 1.2
{@value} 1.4
@version 1.0
Package tags are tags that can appear in the documentation comment for a package (which resides in the source file named package.html). The @serial tag can only be used here with the include or exclude argument.
Package Tags
@see
@since
@serial
@author
@version
{@link}
{@linkplain}
{@docRoot}
The following are tags that can appear in the documentation comment for a class or interface. The @serial tag can only be used here with the include or exclude argument.
Class/Interface 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:
*
* Window win = new Window(parent);
* win.show();
*
*
* @author Sami Shaio
* @version %I%, %G%
* @see java.awt.BaseWindow
* @see java.awt.Button
*/
class Window extends BaseWindow {
...
}
The following are the tags that can appear in the documentation comment for a field.
Field Tags
@see
@since
@deprecated
@serial
@serialField
{@link}
{@linkplain}
{@docRoot}
{@value}
An example of a field comment:
/**
* The X-coordinate of the component.
*
* @see #getLocation()
*/
int x = 1263732;
The following are the tags that can appear in the documentation comment for a constructor or method, except for @return, which cannot appear in a constructor, and {@inheritDoc}, which has certain restrictions. The @serialData tag can only be used in the doc comment for certain serialization methods.
Method/Constructor Tags
@see
@since
@deprecated
@param
@return
@throws and @exception
@serialData
{@link}
{@linkplain}
{@inheritDoc}
{@docRoot}
An example of a method doc comment:
/**
* Returns the character at the specified index. An index
* ranges from
0
to length() - 1
.
*
* @param index the index of the desired character.
* @return the desired character.
* @exception StringIndexOutOfRangeException
* if the index is not in the range 0
* to length()-1
.
* @see java.lang.Character#charValue()
*/
public char charAt(int index) {
...
}
上一篇:C++值元编程
下一篇:从零整理java基础02