类似这样:
/**
* See {@linktourl http://google.com}
*/
这将创建一个包含链接的“参见”标题,例如:
/**
* @see <a href="http://google.com">http://google.com</a>
*/
将渲染为:
而这个:
/**
* See <a href="http://google.com">http://google.com</a>
*/
将创建一个内联链接:
@see <a href="URL#value">label</a>
:
添加一个链接,由URL#value
定义。 URL#value 是相对或绝对URL。 Javadoc工具通过查找小于符号(
<
)作为第一个字符来将其与其他情况区分开来。
例如:@see <a href="http://www.google.com">Google</a>
Javadocs没有为外部链接提供任何特殊工具,因此您应该只使用标准的HTML:
See <a href="http://groversmill.com/">Grover's Mill</a> for a history of the
Martian invasion.
或者@see <a href="http://groversmill.com/">Grover's Mill</a> for a history of
the Martian invasion.
不要使用{@link ...}
或者{@linkplain ...}
,因为它们是用于链接到其他类和方法的javadocs。
javax.ws.rs.core.HttpHeaders.java
:/**
* See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1">HTTP/1.1 documentation</a>}.
*/
public static final String ACCEPT = "Accept";
/**
* See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2">HTTP/1.1 documentation</a>}.
*/
public static final String ACCEPT_CHARSET = "Accept-Charset";
@see
标签应该放在@param
/@return
标签之后,@since
/@serial
/@deprecated
标签之前。 - friederbluemle<a href="http://google.com" target="_top">http://google.com</a>
。添加 target="_top" 的原因是因为某些生成的 javadoc html 文件使用了框架,您可能希望导航影响整个页面,而不仅仅是当前的框架。 - Antony