java Android Studio 中的 Javadoc @link 引用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26466091/
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-11-02 09:58:49  来源:igfitidea点击:

Javadoc @link references in Android Studio

javaandroid-studiojavadoc

提问by Genís

I'm trying to generate some Javadocs with Android Studio. I'm referring with {@link #method()}a method in the same class as the link but I still get a reference not founderror from Javadoc. I'm probably omitting something very stupid but I cannot figure out what it is. Has anybody else come across the same problem?

我正在尝试使用 Android Studio 生成一些 Javadoc。我指的是与{@link #method()}链接相同的类中的方法,但我仍然reference not found从 Javadoc 中收到错误消息。我可能忽略了一些非常愚蠢的事情,但我无法弄清楚它是什么。有没有其他人遇到过同样的问题?

回答by Scott Biggs

In Android Studio within a javadoc comment, try typing {@and then hitting ctrl+spaceto see what pops up...

在 Android Studio 中的 javadoc 注释中,尝试输入{@然后点击ctrl+space以查看弹出的内容...

After choosing link, hit space.

选择后link,点击space

Now try ctrl+spaceagain for a list of all possible classes.

现在再次尝试ctrl+space以获取所有可能的类的列表。

To just make a reference to a method/data within the current class, type #and then ctrl+spaceto see a list of probably-what-you-want.

要仅引用当前类中的方法/数据,请键入#然后ctrl+space以查看您可能需要的列表。

Don't forget to make sure the brackets are closed!

不要忘记确保括号已关闭!

回答by Richard Goggin

The format for the javaDoc lint tag in Android Studio is:

Android Studio 中 javaDoc lint 标签的格式为:

{@link package.class#member label}

Here is more information on javaDoc tags.

这里有更多关于javaDoc 标签的信息。

回答by adam

I don't know if anyone is still struggling with it but if you are and {@linkis not working then make sure your comment block looks something like this

我不知道是否有人还在{@link为此苦苦挣扎,但如果您正在工作并且没有工作,请确保您的评论块看起来像这样

/**
* {@link 'your reference'
*/

make sure that the comment block starts with two *and not one, apparently, this works for me in the android studio.

确保评论块以两个*而不是一个开头,显然,这在 android studio 中对我有用。