public class InvalidJavadocPositionCheck extends AbstractCheck
Checks that Javadocs are located at the correct position. As specified at Documentation Comment Specification for the Standard Doclet, Javadocs are recognized only when placed immediately before module, package, class, interface, constructor, method, or field declarations. Any other position, like in the body of a method, will be ignored by the javadoc tool and is considered invalid by this check.
To configure the check:
<module name="InvalidJavadocPosition"/>
The following code produces a violation because Javadocs should be before all annotations of the Javadoc's target:
@SuppressWarnings("serial") /** * This comment looks like javadoc but it at an invalid location. * Therefore, the text will not get into TestClass.html and the check will produce a violation. */ public class TestClass { }
AutomaticBean.OutputStreamOptions
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MSG_KEY
A key is pointing to the warning message text in "messages.properties"
file.
|
Constructor and Description |
---|
InvalidJavadocPositionCheck() |
Modifier and Type | Method and Description |
---|---|
int[] |
getAcceptableTokens()
The configurable token set.
|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
int[] |
getRequiredTokens()
The tokens that this check must be registered for.
|
boolean |
isCommentNodesRequired()
Whether comment nodes are required or not.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
beginTree, clearMessages, destroy, finishTree, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, leaveToken, log, log, log, setFileContents, setTabWidth, setTokens
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
configure, contextualize, getConfiguration, setupChild
public static final java.lang.String MSG_KEY
public InvalidJavadocPositionCheck()
public int[] getDefaultTokens()
AbstractCheck
getDefaultTokens
in class AbstractCheck
TokenTypes
public int[] getAcceptableTokens()
AbstractCheck
getAcceptableTokens
in class AbstractCheck
TokenTypes
public int[] getRequiredTokens()
AbstractCheck
getRequiredTokens
in class AbstractCheck
TokenTypes
public boolean isCommentNodesRequired()
AbstractCheck
isCommentNodesRequired
in class AbstractCheck
public void visitToken(DetailAST ast)
AbstractCheck
visitToken
in class AbstractCheck
ast
- the token to processCopyright © 2001-2019. All Rights Reserved.