public class JavadocMissingWhitespaceAfterAsteriskCheck extends AbstractJavadocCheck
Checks that there is at least one whitespace after the leading asterisk. Although spaces after asterisks are optional in the Javadoc comments, their absence makes the documentation difficult to read. It is the de facto standard to put at least one whitespace after the leading asterisk.
violateExecutionOnNonTightHtml
- Control when to print violations
if the Javadoc being examined by this check violates the tight html rules defined at
Tight-HTML Rules.
Type is boolean
.
Default value is false
.
To configure the default check:
<module name="JavadocMissingWhitespaceAfterAsterisk"/>
Code Example:
/** This is valid single-line Javadoc. */ class TestClass { /** *This is invalid Javadoc. */ int invalidJavaDoc; /** * This is valid Javadoc. */ void validJavaDocMethod() { } /**This is invalid single-line Javadoc. */ void invalidSingleLineJavaDocMethod() { } /** This is valid single-line Javadoc. */ void validSingleLineJavaDocMethod() { } }
Parent is com.puppycrawl.tools.checkstyle.TreeWalker
Violation Message Keys:
javadoc.missed.html.close
javadoc.missing.whitespace
javadoc.parse.rule.error
javadoc.wrong.singleton.html.tag
AutomaticBean.OutputStreamOptions
Modifier and Type | Field and Description |
---|---|
static String |
MSG_KEY
A key is pointing to the warning message text in "messages.properties" file.
|
MSG_JAVADOC_MISSED_HTML_CLOSE, MSG_JAVADOC_PARSE_RULE_ERROR, MSG_JAVADOC_WRONG_SINGLETON_TAG
Constructor and Description |
---|
JavadocMissingWhitespaceAfterAsteriskCheck() |
Modifier and Type | Method and Description |
---|---|
int[] |
getDefaultJavadocTokens()
Returns the default javadoc token types a check is interested in.
|
int[] |
getRequiredJavadocTokens()
The javadoc tokens that this check must be registered for.
|
void |
visitJavadocToken(DetailNode detailNode)
Called to process a Javadoc token.
|
acceptJavadocWithNonTightHtml, beginJavadocTree, beginTree, destroy, finishJavadocTree, finishTree, getAcceptableJavadocTokens, getAcceptableTokens, getBlockCommentAst, getDefaultTokens, getRequiredTokens, init, isCommentNodesRequired, leaveJavadocToken, setJavadocTokens, setViolateExecutionOnNonTightHtml, visitToken
clearMessages, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, leaveToken, log, log, log, setFileContents, setTabWidth, setTokens
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
configure, contextualize, getConfiguration, setupChild
public static final String MSG_KEY
public JavadocMissingWhitespaceAfterAsteriskCheck()
public int[] getDefaultJavadocTokens()
AbstractJavadocCheck
getDefaultJavadocTokens
in class AbstractJavadocCheck
JavadocTokenTypes
public int[] getRequiredJavadocTokens()
AbstractJavadocCheck
getRequiredJavadocTokens
in class AbstractJavadocCheck
JavadocTokenTypes
public void visitJavadocToken(DetailNode detailNode)
AbstractJavadocCheck
visitJavadocToken
in class AbstractJavadocCheck
detailNode
- the token to processCopyright © 2001–2020. All rights reserved.