码迷,mamicode.com
首页 > 编程语言 > 详细

javadoc标签

时间:2020-06-15 20:54:00      阅读:105      评论:0      收藏:0      [点我收藏+]

标签:文档   range   cat   method   ber   cti   dep   rod   sdk   

javadoc标签

The current tags are

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 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). The @serial tag can only be used here with the include or exclude 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 %I%, %G%
 * @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) {
       ...
    }

参考文档

javadoc标签

标签:文档   range   cat   method   ber   cti   dep   rod   sdk   

原文地址:https://www.cnblogs.com/leizhi/p/13137560.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!