Class JavadocStyleCheck
- 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.JavadocStyleCheck
-
- All Implemented Interfaces:
Configurable,Contextualizable
public class JavadocStyleCheck extends AbstractCheck
Custom Checkstyle Check to validate Javadoc.
-
-
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.StringMSG_EMPTYMessage property key for the Unclosed HTML message.static java.lang.StringMSG_EXTRA_HTMLMessage property key for the Extra HTML message.static java.lang.StringMSG_INCOMPLETE_TAGMessage property key for the Unclosed HTML message.static java.lang.StringMSG_JAVADOC_MISSINGMessage property key for the Unclosed HTML message.static java.lang.StringMSG_NO_PERIODMessage property key for the Unclosed HTML message.static java.lang.StringMSG_UNCLOSED_HTMLMessage property key for the Unclosed HTML message.
-
Constructor Summary
Constructors Constructor Description JavadocStyleCheck()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]getAcceptableTokens()The configurable token set.int[]getDefaultTokens()Returns the default token a check is interested in.int[]getRequiredTokens()The tokens that this check must be registered for.voidsetCheckEmptyJavadoc(boolean flag)Sets the flag that determines if empty Javadoc checking should be done.voidsetCheckFirstSentence(boolean flag)Sets the flag that determines if the first sentence is checked for proper end of sentence punctuation.voidsetCheckHtml(boolean flag)Sets the flag that determines if HTML checking is to be performed.voidsetEndOfSentenceFormat(java.util.regex.Pattern pattern)Set the format for matching the end of a sentence.voidsetExcludeScope(Scope excludeScope)Set the excludeScope.voidsetScope(Scope scope)Sets the scope to check.voidvisitToken(DetailAST ast)Called to process a token.-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
beginTree, clearMessages, destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, log, setClassLoader, 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_MISSING
public static final java.lang.String MSG_JAVADOC_MISSING
Message property key for the Unclosed HTML message.- See Also:
- Constant Field Values
-
MSG_EMPTY
public static final java.lang.String MSG_EMPTY
Message property key for the Unclosed HTML message.- See Also:
- Constant Field Values
-
MSG_NO_PERIOD
public static final java.lang.String MSG_NO_PERIOD
Message property key for the Unclosed HTML message.- See Also:
- Constant Field Values
-
MSG_INCOMPLETE_TAG
public static final java.lang.String MSG_INCOMPLETE_TAG
Message property key for the Unclosed HTML message.- See Also:
- Constant Field Values
-
MSG_UNCLOSED_HTML
public static final java.lang.String MSG_UNCLOSED_HTML
Message property key for the Unclosed HTML message.- See Also:
- Constant Field Values
-
MSG_EXTRA_HTML
public static final java.lang.String MSG_EXTRA_HTML
Message property key for the Extra HTML message.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultTokens
public int[] getDefaultTokens()
Description copied from class:AbstractCheckReturns the default token a check is interested in. Only used if the configuration for a check does not define the tokens.- Specified by:
getDefaultTokensin classAbstractCheck- Returns:
- the default tokens
- See Also:
TokenTypes
-
getAcceptableTokens
public int[] getAcceptableTokens()
Description copied from class:AbstractCheckThe configurable token set. Used to protect Checks against malicious users who specify an unacceptable token set in the configuration file. The default implementation returns the check's default tokens.- Specified by:
getAcceptableTokensin classAbstractCheck- Returns:
- the token set this check is designed for.
- See Also:
TokenTypes
-
getRequiredTokens
public int[] getRequiredTokens()
Description copied from class:AbstractCheckThe tokens that this check must be registered for.- Specified by:
getRequiredTokensin classAbstractCheck- Returns:
- the token set this must be registered for.
- See Also:
TokenTypes
-
visitToken
public void visitToken(DetailAST ast)
Description copied from class:AbstractCheckCalled to process a token.- Overrides:
visitTokenin classAbstractCheck- Parameters:
ast- the token to process
-
setScope
public void setScope(Scope scope)
Sets the scope to check.- Parameters:
scope- a scope.
-
setExcludeScope
public void setExcludeScope(Scope excludeScope)
Set the excludeScope.- Parameters:
excludeScope- a scope.
-
setEndOfSentenceFormat
public void setEndOfSentenceFormat(java.util.regex.Pattern pattern)
Set the format for matching the end of a sentence.- Parameters:
pattern- a pattern.
-
setCheckFirstSentence
public void setCheckFirstSentence(boolean flag)
Sets the flag that determines if the first sentence is checked for proper end of sentence punctuation.- Parameters:
flag-trueif the first sentence is to be checked
-
setCheckHtml
public void setCheckHtml(boolean flag)
Sets the flag that determines if HTML checking is to be performed.- Parameters:
flag-trueif HTML checking is to be performed.
-
setCheckEmptyJavadoc
public void setCheckEmptyJavadoc(boolean flag)
Sets the flag that determines if empty Javadoc checking should be done.- Parameters:
flag-trueif empty Javadoc checking should be done.
-
-