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) {
...
}

最新文章

  1. 基于Metronic的Bootstrap开发框架经验总结(12)--页面链接收藏夹功能的实现
  2. T-SQL Recipes之生成动态列表数据
  3. Git的.gitignore文件配置
  4. jstl标签
  5. ssh远程连接ubuntu
  6. python学习道路(day2note)(数据类型,运算符,字符串,列表)
  7. C++中static用法总结
  8. 如何在RedHat6(7) or CentOS6(7)上制作无依赖的PostgreSQL数据库的RPM包
  9. Swift URL Schemes使用
  10. js运动 分享到
  11. 琐碎-hadoop2.2.0伪分布式和完全分布式安装(centos6.4)
  12. 如何从零开始实现一个soa远程调用服务基础组件
  13. 在ASP.NET MVC中对手机号码的验证
  14. ASCII码表完整版
  15. JS第二部分--DOM文档对象模型
  16. 使goroutine同步的方法总结
  17. Git 安装及用法 github 代码发布 gitlab私有仓库的搭建
  18. repository和repertory
  19. NYOJ 92
  20. 在jQuery定义自己的扩展方法函数

热门文章

  1. Spring Boot 报错:Error creating bean with name &#39;entityManagerFactory&#39; defined in class path resource
  2. 判断网络类(获取mac) InternetCheck
  3. 使用 Lombok 简化项目中无谓的Java代码
  4. Bootstrap-CL:面包屑导航
  5. 浏览器禁用Cookie
  6. EMF与GEF
  7. Selenium Webdriver——Table类封装
  8. sqlserver数据库导出成insert语句
  9. UNITY C#内存泄漏
  10. MVC-READ4