Class JavadocMissingLeadingAsteriskCheck
java.lang.Object
com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
com.puppycrawl.tools.checkstyle.api.AbstractCheck
com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck
com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck
- All Implemented Interfaces:
Configurable,Contextualizable
Checks if the javadoc has
leading asterisks on each line.
The check does not require asterisks on the first line, nor on the last line if it is blank.
All other lines in a Javadoc should start with *, including blank lines and code blocks.
-
Property
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 isboolean. Default value isfalse.
Parent is com.puppycrawl.tools.checkstyle.TreeWalker
Violation Message Keys:
-
javadoc.missed.html.close -
javadoc.missing.asterisk -
javadoc.parse.rule.error -
javadoc.unclosedHtml -
javadoc.wrong.singleton.html.tag
- Since:
- 8.38
-
Nested Class Summary
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
AbstractAutomaticBean.OutputStreamOptions -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA key is pointing to the warning message text in "messages.properties" file.Fields inherited from class com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck
MSG_JAVADOC_MISSED_HTML_CLOSE, MSG_JAVADOC_PARSE_RULE_ERROR, MSG_JAVADOC_WRONG_SINGLETON_TAG, MSG_KEY_UNCLOSED_HTML_TAG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]The configurable javadoc token set.int[]Returns the default javadoc token types a check is interested in.private static DetailNodegetNextNode(DetailNode detailNode) Gets next node in the ast (sibling or parent sibling for the last node).int[]The javadoc tokens that this check must be registered for.private static booleanisLastLine(DetailNode detailNode) Checks whether this node is the end of a Javadoc comment, optionally preceded by blank text.private static booleanisLeadingAsterisk(DetailNode detailNode) Checks whether the given node is a leading asterisk.voidvisitJavadocToken(DetailNode detailNode) Called to process a Javadoc token.Methods inherited from class com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck
acceptJavadocWithNonTightHtml, beginJavadocTree, beginTree, destroy, finishJavadocTree, finishTree, getAcceptableTokens, getBlockCommentAst, getDefaultTokens, getRequiredTokens, init, isCommentNodesRequired, leaveJavadocToken, setJavadocTokens, setViolateExecutionOnNonTightHtml, visitTokenMethods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
clearViolations, getFileContents, getFilePath, getLine, getLineCodePoints, getLines, getTabWidth, getTokenNames, getViolations, leaveToken, log, log, log, setFileContents, setTabWidth, setTokensMethods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverityMethods inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
configure, contextualize, getConfiguration, setupChild
-
Field Details
-
MSG_MISSING_ASTERISK
A key is pointing to the warning message text in "messages.properties" file.- See Also:
-
-
Constructor Details
-
JavadocMissingLeadingAsteriskCheck
public JavadocMissingLeadingAsteriskCheck()
-
-
Method Details
-
getRequiredJavadocTokens
Description copied from class:AbstractJavadocCheckThe javadoc tokens that this check must be registered for.- Overrides:
getRequiredJavadocTokensin classAbstractJavadocCheck- Returns:
- the javadoc token set this must be registered for.
- See Also:
-
getAcceptableJavadocTokens
Description copied from class:AbstractJavadocCheckThe configurable javadoc token set. Used to protect Checks against malicious users who specify an unacceptable javadoc token set in the configuration file. The default implementation returns the check's default javadoc tokens.- Overrides:
getAcceptableJavadocTokensin classAbstractJavadocCheck- Returns:
- the javadoc token set this check is designed for.
- See Also:
-
getDefaultJavadocTokens
Description copied from class:AbstractJavadocCheckReturns the default javadoc token types a check is interested in.- Specified by:
getDefaultJavadocTokensin classAbstractJavadocCheck- Returns:
- the default javadoc token types
- See Also:
-
visitJavadocToken
Description copied from class:AbstractJavadocCheckCalled to process a Javadoc token.- Specified by:
visitJavadocTokenin classAbstractJavadocCheck- Parameters:
detailNode- the token to process
-
getNextNode
Gets next node in the ast (sibling or parent sibling for the last node).- Parameters:
detailNode- the node to process- Returns:
- next node.
-
isLeadingAsterisk
Checks whether the given node is a leading asterisk.- Parameters:
detailNode- the node to process- Returns:
trueif the node isJavadocTokenTypes.LEADING_ASTERISK
-
isLastLine
Checks whether this node is the end of a Javadoc comment, optionally preceded by blank text.- Parameters:
detailNode- the node to process- Returns:
trueif the node isJavadocTokenTypes.EOF
-