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 |
SUMMARY_FIRST_SENTENCE
A key is pointing to the warning message text in "messages.properties"
file.
|
static String |
SUMMARY_JAVADOC
A key is pointing to the warning message text in "messages.properties"
file.
|
PARSE_ERROR_MESSAGE_KEY, UNRECOGNIZED_ANTLR_ERROR_MESSAGE_KEY| 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, visitTokendestroy, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic static final String SUMMARY_FIRST_SENTENCE
public static final String 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()
AbstractJavadocCheckgetDefaultJavadocTokens in class AbstractJavadocCheckJavadocTokenTypespublic int[] getAcceptableTokens()
CheckgetAcceptableTokens in class CheckTokenTypespublic int[] getRequiredTokens()
CheckgetRequiredTokens in class CheckTokenTypespublic void visitJavadocToken(DetailNode ast)
AbstractJavadocCheckvisitJavadocToken in class AbstractJavadocCheckast - the token to processCopyright © 2001-2015. All Rights Reserved.