public abstract class AbstractAddonsCheck extends Check
Modifier | Constructor and Description |
---|---|
protected |
AbstractAddonsCheck() |
protected |
AbstractAddonsCheck(String pMockfile) |
Modifier and Type | Method and Description |
---|---|
void |
beginTree(DetailAST pRootAst) |
protected void |
finishTree(BinaryName pOuterClassName,
DetailAST pRootAst)
Called after a tree is fully processed.
|
void |
finishTree(DetailAST pRootAst) |
protected CheckstyleApiFixer |
getApiFixer() |
protected DetailAST |
getClassDeclarationPosition(BinaryName pBinaryName) |
protected BinaryName |
getCurrentBinaryName()
Gets the binary name of the class currently being traversed on the AST.
|
protected String |
getCurrentSimpleName()
Gets the simple name of the current class, interface, annotation, or enum.
|
int[] |
getDefaultTokens() |
protected String |
getMyPackage() |
abstract Set<Integer> |
getRelevantTokens()
The tokens which this check is interested in.
|
int[] |
getRequiredTokens() |
protected void |
leaveKnownType(BinaryName pBinaryClassName,
DetailAST pAst)
Called after leaving a CLASS_DEF, INTERFACE_DEF, ANNOTATION_DEF, or ENUM_DEF token and the type's binary class
name is known.
|
protected void |
leaveToken(BinaryName pBinaryClassName,
DetailAST pAst)
Called after all the child nodes have been processed.
|
void |
leaveToken(DetailAST pAst) |
protected void |
visitKnownType(BinaryName pBinaryClassName,
DetailAST pAst)
Called after visiting a CLASS_DEF, INTERFACE_DEF, ANNOTATION_DEF, or ENUM_DEF token and successfully determining
the type's binary class name.
|
protected void |
visitToken(BinaryName pBinaryClassName,
DetailAST pAst)
Called to process a token.
|
void |
visitToken(DetailAST pAst) |
destroy, getAcceptableTokens, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public void beginTree(DetailAST pRootAst)
beginTree
in class AbstractCheck
protected void finishTree(@Nonnull BinaryName pOuterClassName, @Nonnull DetailAST pRootAst)
pOuterClassName
- the fully qualified class name of the outer classpRootAst
- the root of the treepublic final void finishTree(DetailAST pRootAst)
finishTree
in class AbstractCheck
@Nonnull protected CheckstyleApiFixer getApiFixer()
@CheckForNull protected DetailAST getClassDeclarationPosition(@Nonnull BinaryName pBinaryName)
@CheckForNull protected BinaryName getCurrentBinaryName()
null
if no CLASS_DEF or similar token has been encountered yet (e.g.
while we are still going through the import
statements)@CheckForNull protected String getCurrentSimpleName()
null
if we are outside of a type definitionpublic final int[] getDefaultTokens()
getDefaultTokens
in class AbstractCheck
protected String getMyPackage()
public abstract Set<Integer> getRelevantTokens()
public int[] getRequiredTokens()
getRequiredTokens
in class AbstractCheck
protected void leaveKnownType(@Nonnull BinaryName pBinaryClassName, @Nonnull DetailAST pAst)
leaveToken(BinaryName, DetailAST)
will be
performed in addition to (before) this one.pBinaryClassName
- the binary class name of the visited typepAst
- the token being completedprotected void leaveToken(@Nullable BinaryName pBinaryClassName, @Nonnull DetailAST pAst)
pBinaryClassName
- the currently active binary class namepAst
- the token being completedpublic final void leaveToken(DetailAST pAst)
leaveToken
in class AbstractCheck
protected void visitKnownType(@Nonnull BinaryName pBinaryClassName, @Nonnull DetailAST pAst)
visitToken(BinaryName, DetailAST)
will
be performed in addition to (after) this one.pBinaryClassName
- the binary class name of the visited typepAst
- the token to processprotected void visitToken(@Nullable BinaryName pBinaryClassName, @Nonnull DetailAST pAst)
pBinaryClassName
- the currently active binary class namepAst
- the token to processpublic final void visitToken(DetailAST pAst)
visitToken
in class AbstractCheck