com.puppycrawl.tools.checkstyle.api
public abstract class Check extends AbstractViolationReporter
Constructor and Description |
---|
Check() |
Modifier and Type | Method and Description |
---|---|
void |
beginTree(DetailAST aRootAST)
Called before the starting to process a tree.
|
void |
destroy()
Destroy the check.
|
void |
finishTree(DetailAST aRootAST)
Called after finished processing a tree.
|
int[] |
getAcceptableTokens()
The configurable token set.
|
ClassLoader |
getClassLoader()
Returns the class loader associated with the tree.
|
abstract int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
FileContents |
getFileContents()
Returns the file contents associated with the tree.
|
String[] |
getLines()
Returns the lines associated with the tree.
|
int[] |
getRequiredTokens()
The tokens that this check must be registered for.
|
protected int |
getTabWidth() |
Set<String> |
getTokenNames()
Returns the tokens registered for the check.
|
void |
init()
Initialise the check.
|
void |
leaveToken(DetailAST aAST)
Called after all the child nodes have been process.
|
void |
log(int aLineNo,
int aColNo,
String aKey,
Object... aArgs)
Log a message that has column information.
|
void |
log(int aLine,
String aKey,
Object... aArgs)
Log a message that has no column information.
|
void |
setClassLoader(ClassLoader aLoader)
Set the class loader associated with the tree.
|
void |
setFileContents(FileContents aContents)
Set the file contents associated with the tree.
|
void |
setMessages(LocalizedMessages aMessages)
Set the global object used to collect messages.
|
void |
setTabWidth(int aTabWidth)
Set the tab width to report errors with.
|
void |
setTokens(String[] aStrRep)
Adds a set of tokens the check is interested in.
|
void |
visitToken(DetailAST aAST)
Called to process a token.
|
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public abstract int[] getDefaultTokens()
TokenTypes
public int[] getAcceptableTokens()
TokenTypes
public int[] getRequiredTokens()
TokenTypes
public final void setTokens(String[] aStrRep)
aStrRep
- the string representation of the tokens interested inpublic final Set<String> getTokenNames()
public final void setMessages(LocalizedMessages aMessages)
aMessages
- the messages to log withpublic void init()
public void destroy()
public void beginTree(DetailAST aRootAST)
aRootAST
- the root of the treepublic void finishTree(DetailAST aRootAST)
aRootAST
- the root of the treepublic void visitToken(DetailAST aAST)
aAST
- the token to processpublic void leaveToken(DetailAST aAST)
aAST
- the token leavingpublic final String[] getLines()
public final void setFileContents(FileContents aContents)
aContents
- the managerpublic final FileContents getFileContents()
public final void setClassLoader(ClassLoader aLoader)
aLoader
- the class loaderpublic final ClassLoader getClassLoader()
protected final int getTabWidth()
public final void setTabWidth(int aTabWidth)
aTabWidth
- an int
valuepublic final void log(int aLine, String aKey, Object... aArgs)
AbstractViolationReporter
log
in class AbstractViolationReporter
aLine
- the line number where the error was foundaKey
- the message that describes the erroraArgs
- the details of the messageMessageFormat
public final void log(int aLineNo, int aColNo, String aKey, Object... aArgs)
AbstractViolationReporter
log
in class AbstractViolationReporter
aLineNo
- the line number where the error was foundaColNo
- the column number where the error was foundaKey
- the message that describes the erroraArgs
- the details of the messageMessageFormat
Copyright © 2001-2014. All Rights Reserved.