链接
使用 @link
标记链接到其他 Javadoc:
/**
* You can link to the javadoc of an already imported class using {@link ClassName}.
*
* You can also use the fully-qualified name, if the class is not already imported:
* {@link some.other.ClassName}
*
* You can link to members (fields or methods) of a class like so:
* {@link ClassName#someMethod()}
* {@link ClassName#someMethodWithParameters(int, String)}
* {@link ClassName#someField}
* {@link #someMethodInThisClass()} - used to link to members in the current class
*
* You can add a label to a linked javadoc like so:
* {@link ClassName#someMethod() link text}
*/
使用 @see
标签,你可以向 See also 部分添加元素。像 @param
或 @return
一样,它们出现的地方无关紧要。规范说你应该在 @return
之后写它。
/**
* This method has a nice explanation but you might found further
* information at the bottom.
*
* @see ClassName#someMethod()
*/
如果要添加**指向外部资源的链接,**只需使用 HTML <a>
标记即可。你可以在 @link
和 @see
标签的任何位置或内部使用它。
/**
* Wondering how this works? You might want
* to check this <a href="http://stackoverflow.com/">great service</a>.
*
* @see <a href="http://stackoverflow.com/">Stack Overflow</a>
*/