Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javadoc @link references in Android Studio

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?

like image 326
Genís Avatar asked Oct 20 '14 12:10

Genís


People also ask

How do you reference a Javadoc code?

Javadoc provides the @link inline tag for referencing the members in the Java classes. We can think of the @link tag as similar to the anchor tag in HTML, which is used to link one page to another via hyperlinks. Similar to the anchor tag, the path_to_member is the destination, and the label is the display text.

What is @link in Java comments?

The @link tag is specifically used to link to the Javadoc of other classes and methods.

How do you add a link to a Javadoc?

@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.

What does @SEE mean in Javadoc?

The format of the @see tag is quite simple: @see reference. For example, we can use it to mark an external link to the official Java documentation: /** * @see <a href="https://docs.oracle.com/en/java/">Java Dcoumentation</a> */ In short, we use the @see tag when we want a link or a text entry that points to a reference ...


2 Answers

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!

like image 149
SMBiggs Avatar answered Sep 29 '22 13:09

SMBiggs


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

{@link package.class#member label} 

Here is more information on javaDoc tags.

like image 39
Richard Goggin Avatar answered Sep 29 '22 13:09

Richard Goggin