Linking to an external URL in Javadoc?
就像是:
/**
* See {@linktourl http://google.com}
*/
This creates a "See Also" heading containing the link, ie:
/**
* @see <a href="http://google.com">http://google.com</a>
*/
will render as:
See Also:
http://google.com
whereas this:
/**
* See <a href="http://google.com">http://google.com</a>
*/
will create an in-line link:
See http://google.com
Taken from the javadoc spec
@see <a href="URL#value">label</a>
: Adds a link as defined by URL#value
. The URL#value
is a relative or absolute URL. The Javadoc tool distinguishes this from other cases by looking for a less-than symbol ( <
) as the first character.
For example : @see <a href="http://www.google.com">Google</a>
Javadocs don't offer any special tools for external links, so you should just use standard html:
See <a href="http://groversmill.com/">Grover's Mill</a> for a history of the
Martian invasion.
or
@see <a href="http://groversmill.com/">Grover's Mill</a> for a history of
the Martian invasion.
Don't use {@link ...}
or {@linkplain ...}
because these are for links to the javadocs of other classes and methods.
上一篇: 如何使用Javadoc选项(比如
下一篇: 链接到Javadoc中的外部URL?