Checking Code for Javadoc Comments
See Also
You can use the Auto Comment Tool to check your source code for Javadoc comments. The
tool determines whether:
- All Java elements that should be commented have Javadoc comments.
- Existing comments correspond with the elements to which they
belong. For example, each parameter in
a method must have an @param tag, each exception thrown from the method
must have an @throws tag, and so on.
To check your source code for Javadoc comments:
- In the Explorer, right-click the file for which you want to check comments. Or,if the file is open in the Source Editor, right-click anywhere in the file. Then choose Tools
Auto Comment.
The Auto Comment Tool is displayed.
The methods in your source file
are listed on the left of the Auto Comment Tool.
The
graphic indicates
a valid Javadoc comment,
indicates a
partial or incorrect comment, and
indicates no comment.
- Select the method for which you want to correct tagging errors or generate missing tags.
- Click Auto Correct.
- If a comment is needed, the IDE
generates the missing tags and displays them in the Tags panel
of the Auto Comment dialog box and in the line immediately
preceding the method in the source file.
-
If a comment is partial or incorrect, the IDE displays information on how to complete the comment in the Details
panel of the Auto Comment dialog box.
- Make any other edits. The Details pane indicates "Javadoc
comment OK" when the comment is correct.
For more information about Javadoc tags, visit the Sun Microsystems
web page at
http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/javadoc.html.
For information on how to write Javadoc comments, see
http://java.sun.com/products/jdk/javadoc/writingdoccomments/index.html.
Legal Notices