java 将超文本链接放入 javadoc 中的外部网站

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7341780/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 19:35:36  来源:igfitidea点击:

Putting hypertext link to external internet site inside javadoc

javajavadoc

提问by Androider

I want my javadoc to reference a dev manual that is on my intranet. I would like to know how to do this: I tried using see {@link http://json.org} but this just produced http://json.organd not a hypertext link. Let's say I wanted to point to some wiki page inside the javadoc. How can I do this? I am just trying to have link to external website. So I want something like Example as hypertext link and it points to a full URL to website.

我希望我的 javadoc 引用我内部网上的开发手册。我想知道如何执行此操作:我尝试使用 see {@link http://json.org} 但这只是生成了http://json.org而不是超文本链接。假设我想指向 javadoc 中的某个 wiki 页面。我怎样才能做到这一点?我只是想链接到外部网站。所以我想要像 Example 这样的东西作为超文本链接,它指向网站的完整 URL。

回答by Stephen P

{@link}and {@linkplain}are specifically used to link to other javadoc.

{@link}并且{@linkplain}专门用于链接到其他 javadoc。

To link to a plain web page you can simply use an HTML link:

要链接到普通网页,您只需使用 HTML 链接:

* @see <a href="http://json.org/">The JSON site</a>

回答by Alexander

/**
* some text <a href="https://www.example1.com">some in text link</a>
* @see <a href="https://www.example2.com">some other link</a>
*/
public void someFunction() {}

will be displayed as

将显示为

public void someFunction()

some text some in text link

See also:
some other link

public void someFunction()

一些文本一些文本链接

另见:
其他一些链接