The major important thing is the documentation has to be implementation independent and specification concise. Dependencies where ever necessary are allowed to be specified.
Also it is allows HTML tags to be used in between the documentation comments. Pretty much all tags are self explanatory.
Meta Annotations
@author Ex: @author Jane Doe
@version Ex: @version v1.0-alpha
@since Ex: @since 2015-09-22
Method Annotations
@param parameter description Ex: @param img the image to be passed
@return parameter description Ex: @return img the image to be returned
@throws/exception description Ex: @throws IOException If I/O exception occurred
Deprecated
@deprecated deprecated-text(optional) Ex: @deprecated since version v1.0
Linking
@see reference Ex: @see package.ClassA/url/string
{@link package.class#member label} Ex: {@link URL}/{@link ImageObserver} This is descriptive text
@serial/serialField/serialData Ex: @serialField Field1
-
Write keywords in "code" tag example : null with this tag.
-
Add the tags in the following order :
@author (classes and interfaces)
@version (classes and interfaces)
@param (methods and constructors)
@return (methods)
@exception (@throws from Javadoc 1.2)
@see (If multiple @see, then order according to distance from current file)
@since (Follow format throughout document)
@serial (or @serialField or @serialData)
@deprecated (see How and When To Deprecate APIs)
- javadoc AddAcc.java : Simply creates Javadoc file in the same directory.
- javadoc -d doc BankAcc.java : creates Javadoc files for the specified file in same directory in specified folder doc.
- javadoc -d doc bankpackage/*.java : Javadoc files for complete package created in doc folder in current directory.
- javadoc -tag newTag. : a : ”New Tag: “ -d doc BankAcc.java : For adding new custom tag in documentation for either specified file or package.
Reference: https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html