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 String
MSG_EMPTY
Message property key for the Unclosed HTML message.static String
MSG_EXTRA_HTML
Message property key for the Extra HTML message.static String
MSG_INCOMPLETE_TAG
Message property key for the Unclosed HTML message.static String
MSG_JAVADOC_MISSING
Message property key for the Unclosed HTML message.static String
MSG_NO_PERIOD
Message property key for the Unclosed HTML message.static String
MSG_UNCLOSED_HTML
Message 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.void
setCheckEmptyJavadoc(boolean flag)
Sets the flag that determines if empty Javadoc checking should be done.void
setCheckFirstSentence(boolean flag)
Sets the flag that determines if the first sentence is checked for proper end of sentence punctuation.void
setCheckHtml(boolean flag)
Sets the flag that determines if HTML checking is to be performed.void
setEndOfSentenceFormat(Pattern pattern)
Set the format for matching the end of a sentence.void
setExcludeScope(Scope excludeScope)
Set the excludeScope.void
setScope(Scope scope)
Sets the scope to check.void
visitToken(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 String MSG_JAVADOC_MISSING
Message property key for the Unclosed HTML message.- See Also:
- Constant Field Values
-
MSG_EMPTY
public static final String MSG_EMPTY
Message property key for the Unclosed HTML message.- See Also:
- Constant Field Values
-
MSG_NO_PERIOD
public static final String MSG_NO_PERIOD
Message property key for the Unclosed HTML message.- See Also:
- Constant Field Values
-
MSG_INCOMPLETE_TAG
public static final String MSG_INCOMPLETE_TAG
Message property key for the Unclosed HTML message.- See Also:
- Constant Field Values
-
MSG_UNCLOSED_HTML
public static final String MSG_UNCLOSED_HTML
Message property key for the Unclosed HTML message.- See Also:
- Constant Field Values
-
MSG_EXTRA_HTML
public static final 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:AbstractCheck
Returns the default token a check is interested in. Only used if the configuration for a check does not define the tokens.- Specified by:
getDefaultTokens
in classAbstractCheck
- Returns:
- the default tokens
- See Also:
TokenTypes
-
getAcceptableTokens
public int[] getAcceptableTokens()
Description copied from class:AbstractCheck
The 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:
getAcceptableTokens
in classAbstractCheck
- Returns:
- the token set this check is designed for.
- See Also:
TokenTypes
-
getRequiredTokens
public int[] getRequiredTokens()
Description copied from class:AbstractCheck
The tokens that this check must be registered for.- Specified by:
getRequiredTokens
in classAbstractCheck
- Returns:
- the token set this must be registered for.
- See Also:
TokenTypes
-
visitToken
public void visitToken(DetailAST ast)
Description copied from class:AbstractCheck
Called to process a token.- Overrides:
visitToken
in 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(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
-true
if 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
-true
if 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
-true
if empty Javadoc checking should be done.
-
-