Entering Javadoc Comments in Source Code
See Also
You can use the Auto Comment Tool to automatically enter Javadoc comments
for any code elements that are not documented. The Auto Comment Tool determines
whether:
- All Java elements that should be documented 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:
- Right-click the file you want to check in the Filesystems window or Source
Editor and choose Tools
Auto
Comment.
The Auto Comment Tool opens in a Source Editor tab. The methods in your
source file are listed in the left pane. 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.
- Close the tab in the Source Editor when you are finished.
For more information about Javadoc tags, see:
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