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?
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.
The @link tag is specifically used to link to the Javadoc of other classes and methods.
@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.
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 ...
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!
The format for the javaDoc lint tag in Android Studio is:
{@link package.class#member label}
Here is more information on javaDoc tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With