javadoc tags
Where Tags Can Be Used
The following sections describe where the tags can be used. Note that these tags can be used in all doc comments: @see
, @since
, @deprecated
, {@link}
, {@linkplain}
, and {@docroot}
.
Overview Documentation Tags
Overview tags are tags that can appear in the documentation comment for the overview page (which resides in the source file typically named overview.html
). Like in any other documentation comments, these tags must appear after the main description.
NOTE - The {@link}
tag has a bug in overview documents in version 1.2 – the text appears properly but has no link. The {@docRoot}
tag does not currently work in overview documents.
Overview Tags |
---|
@see |
@since |
@author |
@version |
{@link} |
{@linkplain} |
{@docRoot} |
Package Documentation Tags
Package tags are tags that can appear in the documentation comment for a package (which resides in the source file named package.html
or package-info.java
). The @serial
tag can only be used here with the include
orexclude
argument.
Package Tags |
---|
@see |
@since |
@serial |
@author |
@version |
{@link} |
{@linkplain} |
{@docRoot} |
Class and Interface Documentation Tags
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:
* <pre>
* Window win = new Window(parent);
* win.show();
* </pre>
*
* @author Sami Shaio
* @version 1.15, 13 Dec 2006
* @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 |
{@link} |
{@linkplain} |
{@docRoot} |
{@value} |
An example of a field comment:
/**
* The X-coordinate of the component.
*
* @see #getLocation()
*/
int x = 1263732;
Constructor and Method Documentation Tags
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 <code>0</code> to <code>length() - 1</code>.
*
* @param index the index of the desired character.
* @return the desired character.
* @exception StringIndexOutOfRangeException
* if the index is not in the range <code>0</code>
* to <code>length()-1</code>.
* @see java.lang.Character#charValue()
*/
public char charAt(int index) {
...
}
最新文章
- 基于Metronic的Bootstrap开发框架经验总结(12)--页面链接收藏夹功能的实现
- T-SQL Recipes之生成动态列表数据
- Git的.gitignore文件配置
- jstl标签
- ssh远程连接ubuntu
- python学习道路(day2note)(数据类型,运算符,字符串,列表)
- C++中static用法总结
- 如何在RedHat6(7) or CentOS6(7)上制作无依赖的PostgreSQL数据库的RPM包
- Swift URL Schemes使用
- js运动 分享到
- 琐碎-hadoop2.2.0伪分布式和完全分布式安装(centos6.4)
- 如何从零开始实现一个soa远程调用服务基础组件
- 在ASP.NET MVC中对手机号码的验证
- ASCII码表完整版
- JS第二部分--DOM文档对象模型
- 使goroutine同步的方法总结
- Git 安装及用法 github 代码发布 gitlab私有仓库的搭建
- repository和repertory
- NYOJ 92
- 在jQuery定义自己的扩展方法函数