public abstract class AbstractMethodCallCheck extends AbstractAddonsCheck
| Constructor and Description |
|---|
AbstractMethodCallCheck() |
| Modifier and Type | Method and Description |
|---|---|
void |
beginTree(DetailAST pRootAst) |
String |
getCurrentMethodName()
The current method name.
|
Set<Integer> |
getRelevantTokens()
The tokens which this check is interested in.
|
protected abstract boolean |
isCheckActive()
Determines if the check is configured to do anything at all.
|
protected abstract boolean |
isRelevantCall(String pQualifier,
String pMethodName)
Filter method which determines if the given method call is considered relevant.
|
protected void |
leaveToken(BinaryName pBinaryClassName,
DetailAST pAst)
Called after all the child nodes have been processed.
|
protected abstract void |
visitMethodCall(String pMethodName,
DetailAST pMethodCallAst)
Visitor method called when a relevant method call is encountered.
|
protected void |
visitToken(BinaryName pBinaryClassName,
DetailAST pAst)
Called to process a token.
|
finishTree, finishTree, getApiFixer, getClassDeclarationPosition, getCurrentBinaryName, getCurrentSimpleName, getDefaultTokens, getMyPackage, getRequiredTokens, leaveKnownType, leaveToken, visitKnownType, visitTokendestroy, getAcceptableTokens, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic Set<Integer> getRelevantTokens()
AbstractAddonsCheckgetRelevantTokens in class AbstractAddonsCheckprotected abstract boolean isCheckActive()
true if processing should be performedprotected abstract boolean isRelevantCall(@Nonnull String pQualifier, @Nonnull String pMethodName)
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)protected abstract void visitMethodCall(@Nonnull String pMethodName, @Nonnull DetailAST pMethodCallAst)
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)@CheckForNull public String getCurrentMethodName()
"<init>" is used for constructors and instance initializers, and
"<clinit>" is used for static initializers.null if we are not inside a method, constructor, or initializerpublic void beginTree(DetailAST pRootAst)
beginTree in class AbstractAddonsCheckprotected void visitToken(@Nullable BinaryName pBinaryClassName, @Nonnull DetailAST pAst)
AbstractAddonsCheckvisitToken in class AbstractAddonsCheckpBinaryClassName - the currently active binary class namepAst - the token to processprotected void leaveToken(@Nullable BinaryName pBinaryClassName, @Nonnull DetailAST pAst)
AbstractAddonsCheckleaveToken in class AbstractAddonsCheckpBinaryClassName - the currently active binary class namepAst - the token being completed