如何编写javadoc链接? [英] How to write javadoc links?
问题描述
如何将链接写入javadoc?
How do I write links into javadocs?
目前,我有类似的内容:
Currently, I have something like:
{@link java.lang.Math#sqrt(double) Math.sqrt}
生成应该链接到 java.lang.Math.sqrt(double)
Math.sqrt >但是,它所做的就是生成文本,没有链接。
to produce the text Math.sqrt
that should link to the java.lang.Math.sqrt(double)
API, however, all it does is produce the text, no link.
推荐答案
获取指向外部内容的链接代码,您需要使用 -linkoffline
选项
To get a link to something external to your code, you need use the -linkoffline
option
其中 -linkoffline
选项的格式如下(人为包装):
where the -linkoffline
option has the format something like this (artificially wrapped):
-linkoffline http://java.sun.com/javase/6/docs/api/
http://java.sun.com/javase/6/docs/api/
这告诉JavaDoc工具在哪里可以找到JavaDoc的链接以及使用该链接的包。从第二个URL,它将附加package-list以加载实际的URL:
This tells the JavaDoc tool where to find the link to the JavaDoc and for what packages to use that link. From the 2nd URL, it will append "package-list" to load the actual URL:
http://java.sun.com/javase/6/docs/api/package-list
确实包含该JavaDoc URL中记录的软件包列表。这告诉JavaDoc工具任何 @link
对其中一个包中的任何内容的引用应链接到提供的URL。
which you can verify by loading it in a browser does contain the list of packages documented at that JavaDoc URL. This tells the JavaDoc tool that any @link
references to anything in one of those packages should link to the provided URL.
这篇关于如何编写javadoc链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!