Package org.infinispan.checkstyle.checks
Class ForbiddenMethodCheck
java.lang.Object
com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
com.puppycrawl.tools.checkstyle.api.AbstractCheck
org.infinispan.checkstyle.checks.ForbiddenMethodCheck
- All Implemented Interfaces:
com.puppycrawl.tools.checkstyle.api.Configurable,com.puppycrawl.tools.checkstyle.api.Contextualizable
public class ForbiddenMethodCheck
extends com.puppycrawl.tools.checkstyle.api.AbstractCheck
Checks that certain methods are not invoked
The methodPattern argument is a regular expression, invocations of method names matching the pattern are forbidden.
Only method names are checked, the defining class doesn't matter.
If the optional argumentCount argument is set, only overloads with that number of parameters are forbidden.
Forbidding only overloads with 0 arguments is not supported at this time.
- Since:
- 10.0
- Author:
- wburns
-
Nested Class Summary
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]int[]int[]voidinit()voidsetArgumentCount(String argumentCountString) voidsetMethodPattern(String methodPatternString) voidvisitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast) Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
beginTree, clearViolations, destroy, finishTree, getFileContents, getFilePath, getLine, getLineCodePoints, getLines, getTabWidth, getTokenNames, getViolations, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokensMethods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverityMethods inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
configure, contextualize, getConfiguration, setupChild
-
Constructor Details
-
ForbiddenMethodCheck
public ForbiddenMethodCheck()
-
-
Method Details
-
getDefaultTokens
public int[] getDefaultTokens()- Specified by:
getDefaultTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
getAcceptableTokens
public int[] getAcceptableTokens()- Specified by:
getAcceptableTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
getRequiredTokens
public int[] getRequiredTokens()- Specified by:
getRequiredTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
init
public void init()- Overrides:
initin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
setMethodPattern
-
setArgumentCount
-
visitToken
public void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast) - Overrides:
visitTokenin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-