public class RequireEmptyLineBeforeBlockTagGroupCheck extends AbstractJavadocCheck
Checks that one blank line before the block tag if it is present in Javadoc.
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 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
AutomaticBean.OutputStreamOptions| Modifier and Type | Field and 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.
|
MSG_JAVADOC_MISSED_HTML_CLOSE, MSG_JAVADOC_PARSE_RULE_ERROR, MSG_JAVADOC_WRONG_SINGLETON_TAG| Constructor and Description |
|---|
RequireEmptyLineBeforeBlockTagGroupCheck() |
| Modifier and Type | Method and 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.
|
acceptJavadocWithNonTightHtml, beginJavadocTree, beginTree, destroy, finishJavadocTree, finishTree, getAcceptableJavadocTokens, getAcceptableTokens, getBlockCommentAst, getDefaultTokens, getRequiredTokens, init, isCommentNodesRequired, leaveJavadocToken, setJavadocTokens, setViolateExecutionOnNonTightHtml, visitTokenclearMessages, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, leaveToken, log, log, log, setFileContents, setTabWidth, setTokensfinishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverityconfigure, contextualize, getConfiguration, setupChildpublic static final java.lang.String MSG_JAVADOC_TAG_LINE_BEFORE
public RequireEmptyLineBeforeBlockTagGroupCheck()
public int[] getDefaultJavadocTokens()
getDefaultJavadocTokens in class AbstractJavadocCheckJavadocTokenTypespublic int[] getRequiredJavadocTokens()
AbstractJavadocCheckgetRequiredJavadocTokens in class AbstractJavadocCheckJavadocTokenTypespublic void visitJavadocToken(DetailNode tagNode)
visitJavadocToken in class AbstractJavadocChecktagNode - the at tag node to check for an empty space before it.Copyright © 2001-2020. All Rights Reserved.