public abstract class AbstractAddonsCheck
extends com.puppycrawl.tools.checkstyle.api.AbstractCheck
Modifier | Constructor and Description |
---|---|
protected |
AbstractAddonsCheck() |
protected |
AbstractAddonsCheck(java.lang.String pMockfile) |
Modifier and Type | Method and Description |
---|---|
void |
beginTree(com.puppycrawl.tools.checkstyle.api.DetailAST pRootAst) |
protected void |
finishTree(BinaryName pOuterClassName,
com.puppycrawl.tools.checkstyle.api.DetailAST pRootAst)
Called after a tree is fully processed.
|
void |
finishTree(com.puppycrawl.tools.checkstyle.api.DetailAST pRootAst) |
int[] |
getAcceptableTokens() |
protected CheckstyleApiFixer |
getApiFixer() |
protected com.puppycrawl.tools.checkstyle.api.DetailAST |
getClassDeclarationPosition(BinaryName pBinaryName) |
protected BinaryName |
getCurrentBinaryName()
Gets the binary name of the class currently being traversed on the AST.
|
protected java.lang.String |
getCurrentSimpleName()
Gets the simple name of the current class, interface, annotation, or enum.
|
int[] |
getDefaultTokens() |
protected java.lang.String |
getMyPackage() |
abstract java.util.Set<java.lang.Integer> |
getRelevantTokens()
The tokens which this check is interested in.
|
int[] |
getRequiredTokens() |
protected void |
leaveKnownType(BinaryName pBinaryClassName,
com.puppycrawl.tools.checkstyle.api.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,
com.puppycrawl.tools.checkstyle.api.DetailAST pAst)
Called after all the child nodes have been processed.
|
void |
leaveToken(com.puppycrawl.tools.checkstyle.api.DetailAST pAst) |
protected void |
visitKnownType(BinaryName pBinaryClassName,
com.puppycrawl.tools.checkstyle.api.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,
com.puppycrawl.tools.checkstyle.api.DetailAST pAst)
Called to process a token.
|
void |
visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST pAst) |
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 AbstractAddonsCheck()
protected AbstractAddonsCheck(@Nullable java.lang.String pMockfile)
public void beginTree(com.puppycrawl.tools.checkstyle.api.DetailAST pRootAst)
beginTree
in class com.puppycrawl.tools.checkstyle.api.AbstractCheck
protected void finishTree(@Nonnull BinaryName pOuterClassName, @Nonnull com.puppycrawl.tools.checkstyle.api.DetailAST pRootAst)
pOuterClassName
- the fully qualified class name of the outer classpRootAst
- the root of the treepublic final void finishTree(com.puppycrawl.tools.checkstyle.api.DetailAST pRootAst)
finishTree
in class com.puppycrawl.tools.checkstyle.api.AbstractCheck
public final int[] getAcceptableTokens()
getAcceptableTokens
in class com.puppycrawl.tools.checkstyle.api.AbstractCheck
@Nonnull protected CheckstyleApiFixer getApiFixer()
@CheckForNull protected com.puppycrawl.tools.checkstyle.api.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 java.lang.String getCurrentSimpleName()
null
if we are outside of a type definitionpublic final int[] getDefaultTokens()
getDefaultTokens
in class com.puppycrawl.tools.checkstyle.api.AbstractCheck
protected java.lang.String getMyPackage()
public abstract java.util.Set<java.lang.Integer> getRelevantTokens()
public final int[] getRequiredTokens()
getRequiredTokens
in class com.puppycrawl.tools.checkstyle.api.AbstractCheck
protected void leaveKnownType(@Nonnull BinaryName pBinaryClassName, @Nonnull com.puppycrawl.tools.checkstyle.api.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 com.puppycrawl.tools.checkstyle.api.DetailAST pAst)
pBinaryClassName
- the currently active binary class namepAst
- the token being completedpublic final void leaveToken(com.puppycrawl.tools.checkstyle.api.DetailAST pAst)
leaveToken
in class com.puppycrawl.tools.checkstyle.api.AbstractCheck
protected void visitKnownType(@Nonnull BinaryName pBinaryClassName, @Nonnull com.puppycrawl.tools.checkstyle.api.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 com.puppycrawl.tools.checkstyle.api.DetailAST pAst)
pBinaryClassName
- the currently active binary class namepAst
- the token to processpublic final void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST pAst)
visitToken
in class com.puppycrawl.tools.checkstyle.api.AbstractCheck