Package com.qulice.checkstyle
Class ProhibitNonFinalClassesCheck
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
-
- com.puppycrawl.tools.checkstyle.api.AbstractCheck
-
- com.qulice.checkstyle.ProhibitNonFinalClassesCheck
-
- All Implemented Interfaces:
Configurable
,Contextualizable
public final class ProhibitNonFinalClassesCheck extends AbstractCheck
Checks that classes are declared as final. Doesn't check for classes nested in interfaces or annotations, as they are alwaysfinal
there.An example of how to configure the check is:
<module name="ProhibitNonFinalClassesCheck"/>
- Since:
- 0.19
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
AutomaticBean.OutputStreamOptions
-
-
Constructor Summary
Constructors Constructor Description ProhibitNonFinalClassesCheck()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginTree(DetailAST root)
int[]
getAcceptableTokens()
int[]
getDefaultTokens()
int[]
getRequiredTokens()
void
leaveToken(DetailAST ast)
void
visitToken(DetailAST ast)
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
clearMessages, destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, isCommentNodesRequired, 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
-
-
-
-
Method Detail
-
getDefaultTokens
public int[] getDefaultTokens()
- Specified by:
getDefaultTokens
in classAbstractCheck
-
getAcceptableTokens
public int[] getAcceptableTokens()
- Specified by:
getAcceptableTokens
in classAbstractCheck
-
getRequiredTokens
public int[] getRequiredTokens()
- Specified by:
getRequiredTokens
in classAbstractCheck
-
beginTree
public void beginTree(DetailAST root)
- Overrides:
beginTree
in classAbstractCheck
-
visitToken
public void visitToken(DetailAST ast)
- Overrides:
visitToken
in classAbstractCheck
-
leaveToken
public void leaveToken(DetailAST ast)
- Overrides:
leaveToken
in classAbstractCheck
-
-