public class IllegalMethodCallCheck extends AbstractMethodCallCheck
Constructor and Description |
---|
IllegalMethodCallCheck() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isCheckActive()
Determines if the check is configured to do anything at all.
|
protected boolean |
isRelevantCall(java.lang.String pQualifier,
java.lang.String pMethodName)
Filter method which determines if the given method call is considered relevant.
|
void |
setExcludedQualifiers(java.lang.String... pExcludedQualifiers)
Setter.
|
void |
setIllegalMethodNames(java.lang.String... pIllegalMethodNames)
Setter.
|
protected void |
visitMethodCall(java.lang.String pMethodName,
com.puppycrawl.tools.checkstyle.api.DetailAST pMethodCallAst)
Visitor method called when a relevant method call is encountered.
|
beginTree, getCurrentMethodName, getRelevantTokens, leaveToken, visitToken
finishTree, finishTree, getAcceptableTokens, getApiFixer, getClassDeclarationPosition, getCurrentBinaryName, getCurrentSimpleName, getDefaultTokens, getMyPackage, getRequiredTokens, leaveKnownType, leaveToken, visitKnownType, visitToken
clearMessages, destroy, getClassLoader, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, isCommentNodesRequired, log, log, log, setClassLoader, setFileContents, setTabWidth, setTokens
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
protected boolean isCheckActive()
AbstractMethodCallCheck
isCheckActive
in class AbstractMethodCallCheck
true
if processing should be performedprotected boolean isRelevantCall(@Nullable java.lang.String pQualifier, @Nonnull java.lang.String pMethodName)
AbstractMethodCallCheck
isRelevantCall
in class AbstractMethodCallCheck
pQualifier
- the qualifier of the method call (for a call like Foo.Bar.call()
, the
qualifier is Foo.Bar
)pMethodName
- the simple name of the called methodtrue
) or not (false
)public void setExcludedQualifiers(java.lang.String... pExcludedQualifiers)
pExcludedQualifiers
- the list of excluded contextspublic void setIllegalMethodNames(java.lang.String... pIllegalMethodNames)
pIllegalMethodNames
- the list of method names to flagprotected void visitMethodCall(@Nonnull java.lang.String pMethodName, @Nonnull com.puppycrawl.tools.checkstyle.api.DetailAST pMethodCallAst)
AbstractMethodCallCheck
visitMethodCall
in class AbstractMethodCallCheck
pMethodName
- the simple name of the called methodpMethodCallAst
- AST of the call, useful for logging issues ( this is a METHOD_DEF, CTOR_CALL, or a
SUPER_CTOR_CALL token)