就像是:
/**
* See {@linktourl http://google.com}
*/
就像是:
/**
* See {@linktourl http://google.com}
*/
这将创建一个“参见”标题包含链接,即:
/**
* @see <a href="http://google.com">http://google.com</a>
*/
将呈现为:
也可以看看:
http://google.com
而这样的:
/**
* See <a href="http://google.com">http://google.com</a>
*/
将创建一个在线链接:
见http://google.com
摘自的javadoc规范
@see <a href="URL#value">label</a>
:将所界定的链接URL#value
。 该URL#value
是相对或绝对URL。 Javadoc工具从其它情况下通过寻找一个小于符号(区分这<
)作为第一个字符。
例如: @see <a href="http://www.google.com">Google</a>
Javadoc中不提供对外部链接任何特殊的工具,所以你应该只使用标准的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 ...}
因为这些是链接到其他类和方法的javadoc。
只需使用一个HTML链接有一个元素一样
<a href="URL#value">label</a>
好不容易找到从Oracle网站一个明确的答案。 以下是从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";