Javadoc @link references in Android Studio

心已入冬 提交于 2019-12-20 09:49:35

问题


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 found error 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?


回答1:


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

After choosing link, hit space.

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

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

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




回答2:


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

{@link package.class#member label}

Here is more information on javaDoc tags.




回答3:


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

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

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



来源:https://stackoverflow.com/questions/26466091/javadoc-link-references-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!