Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A good reference for popular javadoc tags to use?

Tags:

javadoc

I'd like to use custom tags in my javadocs, but stick to some kind of convention so other people might have an easier time making sense of them. On Oracle's official javadoc documentation page, they've listed the basic tags, which is a small set, compared to the list of tags that appear in my editor's javadoc code hinting.

Is there a good reference online, which lists popular javadoc tags?

like image 523
Pup Avatar asked May 24 '11 17:05

Pup


People also ask

What are valid Javadoc tags?

You add Javadoc tags to classes, methods, and fields. For the @author and @version tags, add them only to classes and interfaces. The @param tags get added only to methods and constructors. The @return tag gets added only to methods.

How do you reference a method in Javadoc?

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 are javadocs and when should they be used?

JavaDoc tool is a document generator tool in Java programming language for generating standard documentation in HTML format. It generates API documentation. It parses the declarations ad documentation in a set of source file describing classes, methods, constructors, and fields.


3 Answers

StackOverflow user Uri has provided a list of custom tags that he proposes as part of his PhD research into the effectiveness of javadocs as an answer to a related question. You could adopt those and have some confidence that you're using something that is backed by some research.

Personally, I'd just stick with the standard javadoc tags and adhere to the best practices noted in Oracle's (Sun's) How to Write Doc Comments for the Javadoc Tool.

like image 102
sho222 Avatar answered Sep 19 '22 21:09

sho222


javadoc (Java JDK 8): http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#CHDJGIJB

javadoc (Java JDK 7): http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#javadoctags

like image 38
Lu55 Avatar answered Sep 18 '22 21:09

Lu55


Not really an answer to the question, but related:

To use custom javadoc tags, you either have to use a custom doclet (which can support any tags it wants), use custom taglets with the standard doclet, or use the -tag command line parameter to define those tags. Otherwise you'll get a warning from javadoc (and no output for this tag).

So it only really makes sense to use custom tags when you are already collaborating with someone who uses them, and this someone will say you what javadoc options you have to use. (Or you add those options yourself).

I don't use any nonstandard tags, the standard ones are enough for me.

like image 38
Paŭlo Ebermann Avatar answered Sep 19 '22 21:09

Paŭlo Ebermann