Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linking to an external URL in Javadoc?

Something like:

/**  * See {@linktourl http://google.com}  */ 
like image 880
ripper234 Avatar asked Jul 04 '09 11:07

ripper234


People also ask

How do I add a URL 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.

Can you use HTML tags in Javadoc comments?

There are no real restrictions on the use of HTML in Javadoc comments. The Javadoc documentation states: Comments are written in HTML - The text must be written in HTML, in that they should use HTML entities and can use HTML tags.

What is @link in Java?

It is shorthand that tells the java docs to insert a link to the desired place when they are being viewed. For instance when you view the javadocs for whatever method has that inside your IDE you'll be shown a link that will take you to the KeyEvent.


1 Answers

This creates a "See Also" heading containing the link, i.e.:

/**  * @see <a href="http://google.com">http://google.com</a>  */ 

will render as:

See Also:
           http://google.com

whereas this:

/**  * See <a href="http://google.com">http://google.com</a>  */ 

will create an in-line link:

See http://google.com

like image 149
aem999 Avatar answered Sep 25 '22 10:09

aem999