Class RequireEmptyLineBeforeBlockTagGroupCheck
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- 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.RequireEmptyLineBeforeBlockTagGroupCheck
-
- All Implemented Interfaces:
Configurable
,Contextualizable
public class RequireEmptyLineBeforeBlockTagGroupCheck extends AbstractJavadocCheck
Checks that one blank line before the block tag if it is present in Javadoc.
-
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
.
To configure the check:
<module name="RequireEmptyLineBeforeBlockTagGroup"/>
By default, the check will report a violation if there is no blank line before the block tag, like in the example below.
/** * testMethod's javadoc. * @return something (violation) */ public boolean testMethod() { return false; }
Valid javadoc should have a blank line separating the parameters, return, throw, or other tags like in the example below.
/** * testMethod's javadoc. * * @param firstParam * @return something */ public boolean testMethod(int firstParam) { return false; }
Parent is
com.puppycrawl.tools.checkstyle.TreeWalker
Violation Message Keys:
-
javadoc.missed.html.close
-
javadoc.parse.rule.error
-
javadoc.tag.line.before
-
javadoc.wrong.singleton.html.tag
- Since:
- 8.36
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
AutomaticBean.OutputStreamOptions
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MSG_JAVADOC_TAG_LINE_BEFORE
The key in "messages.properties" for the message that describes a tag in javadoc requiring an empty line before it.-
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
-
-
Constructor Summary
Constructors Constructor Description RequireEmptyLineBeforeBlockTagGroupCheck()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]
getDefaultJavadocTokens()
Returns only javadoc tags so visitJavadocToken only receives javadoc tags.int[]
getRequiredJavadocTokens()
The javadoc tokens that this check must be registered for.void
visitJavadocToken(DetailNode tagNode)
Logs when there is no empty line before the tag.-
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck
acceptJavadocWithNonTightHtml, beginJavadocTree, beginTree, destroy, finishJavadocTree, finishTree, getAcceptableJavadocTokens, getAcceptableTokens, getBlockCommentAst, getDefaultTokens, getRequiredTokens, init, isCommentNodesRequired, leaveJavadocToken, setJavadocTokens, setViolateExecutionOnNonTightHtml, visitToken
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
clearMessages, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, leaveToken, log, log, log, setFileContents, setTabWidth, setTokens
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, getConfiguration, setupChild
-
-
-
-
Field Detail
-
MSG_JAVADOC_TAG_LINE_BEFORE
public static final java.lang.String MSG_JAVADOC_TAG_LINE_BEFORE
The key in "messages.properties" for the message that describes a tag in javadoc requiring an empty line before it.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultJavadocTokens
public int[] getDefaultJavadocTokens()
Returns only javadoc tags so visitJavadocToken only receives javadoc tags.- Specified by:
getDefaultJavadocTokens
in classAbstractJavadocCheck
- Returns:
- only javadoc tags.
- See Also:
JavadocTokenTypes
-
getRequiredJavadocTokens
public int[] getRequiredJavadocTokens()
Description copied from class:AbstractJavadocCheck
The javadoc tokens that this check must be registered for.- Overrides:
getRequiredJavadocTokens
in classAbstractJavadocCheck
- Returns:
- the javadoc token set this must be registered for.
- See Also:
JavadocTokenTypes
-
visitJavadocToken
public void visitJavadocToken(DetailNode tagNode)
Logs when there is no empty line before the tag.- Specified by:
visitJavadocToken
in classAbstractJavadocCheck
- Parameters:
tagNode
- the at tag node to check for an empty space before it.
-
-