public class SummaryJavadocCheck extends AbstractJavadocCheck
Checks that Javadoc summary sentence does not contain phrases that are not recommended to use. By default Check validate that first sentence is not empty:
<module name="SummaryJavadocCheck"/>
To ensure that summary do not contain phrase like "This method returns", use following config:
<module name="SummaryJavadocCheck"> <property name="forbiddenSummaryFragments" value="^This method returns.*"/> </module>
To specify period symbol at the end of first javadoc sentence - use following config:
<module name="SummaryJavadocCheck"> <property name="period" value="period"/> </module>
Modifier and Type | Field and Description |
---|---|
static String |
MSG_SUMMARY_FIRST_SENTENCE
A key is pointing to the warning message text in "messages.properties"
file.
|
static String |
MSG_SUMMARY_JAVADOC
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, MSG_KEY_PARSE_ERROR, MSG_KEY_UNRECOGNIZED_ANTLR_ERROR
Constructor and Description |
---|
SummaryJavadocCheck() |
Modifier and Type | Method and Description |
---|---|
int[] |
getAcceptableTokens()
The configurable token set.
|
int[] |
getDefaultJavadocTokens()
Returns the default token types a check is interested in.
|
int[] |
getRequiredTokens()
The tokens that this check must be registered for.
|
void |
setForbiddenSummaryFragments(String pattern)
Sets custom value of regular expression for forbidden summary fragments.
|
void |
setPeriod(String period)
Sets value of period symbol at the end of first javadoc sentence.
|
void |
visitJavadocToken(DetailNode ast)
Called to process a Javadoc token.
|
beginJavadocTree, beginTree, finishJavadocTree, finishTree, getBlockCommentAst, getDefaultTokens, isCommentNodesRequired, leaveJavadocToken, visitToken
destroy, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public static final String MSG_SUMMARY_FIRST_SENTENCE
public static final String MSG_SUMMARY_JAVADOC
public SummaryJavadocCheck()
public void setForbiddenSummaryFragments(String pattern)
pattern
- user's value.public void setPeriod(String period)
period
- period's value.public int[] getDefaultJavadocTokens()
AbstractJavadocCheck
getDefaultJavadocTokens
in class AbstractJavadocCheck
JavadocTokenTypes
public int[] getAcceptableTokens()
AbstractCheck
getAcceptableTokens
in class AbstractCheck
TokenTypes
public int[] getRequiredTokens()
AbstractCheck
getRequiredTokens
in class AbstractCheck
TokenTypes
public void visitJavadocToken(DetailNode ast)
AbstractJavadocCheck
visitJavadocToken
in class AbstractJavadocCheck
ast
- the token to processCopyright © 2001–2017. All rights reserved.