|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.puppycrawl.tools.checkstyle.api.AutomaticBean com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter com.puppycrawl.tools.checkstyle.api.Check
The base class for checks.
Constructor Summary | |
Check()
|
Method Summary | |
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. |
java.lang.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. |
java.lang.String[] |
getLines()
Returns the lines associated with the tree. |
int[] |
getRequiredTokens()
The tokens that this check must be registered for. |
protected int |
getTabWidth()
|
java.util.Set |
getTokenNames()
Returns the tokens registered for the check. |
void |
init()
Initialse the check. |
void |
leaveToken(DetailAST aAST)
Called after all the child nodes have been process. |
protected void |
log(int aLineNo,
int aColNo,
java.lang.String aKey,
java.lang.Object[] aArgs)
Helper method to log a LocalizedMessage. |
protected void |
log(int aLine,
java.lang.String aKey,
java.lang.Object[] aArgs)
Log an error message. |
void |
setClassLoader(java.lang.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(java.lang.String[] aStrRep)
Adds a set of tokens the check is interested in. |
void |
visitToken(DetailAST aAST)
Called to process a token. |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter |
getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, setSeverity |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean |
configure, contextualize, finishLocalSetup, getConfiguration, setupChild |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Check()
Method Detail |
public abstract int[] getDefaultTokens()
TokenTypes
public int[] getAcceptableTokens()
TokenTypes
public int[] getRequiredTokens()
TokenTypes
public final void setTokens(java.lang.String[] aStrRep)
aStrRep
- the string representation of the tokens interested inpublic final java.util.Set 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 java.lang.String[] getLines()
public final void setFileContents(FileContents aContents)
aContents
- the managerpublic final FileContents getFileContents()
public final void setClassLoader(java.lang.ClassLoader aLoader)
aLoader
- the class loaderpublic final java.lang.ClassLoader getClassLoader()
protected final int getTabWidth()
public final void setTabWidth(int aTabWidth)
aTabWidth
- an int
valueprotected final void log(int aLine, java.lang.String aKey, java.lang.Object[] aArgs)
log
in class AbstractViolationReporter
aLine
- the line number where the error was foundaKey
- the message that describes the erroraArgs
- the details of the messageMessageFormat
protected final void log(int aLineNo, int aColNo, java.lang.String aKey, java.lang.Object[] aArgs)
log
in class AbstractViolationReporter
aLineNo
- line number to associate with the messageaColNo
- column number to associate with the messageaKey
- key to locale message formataArgs
- arguments for messageMessageFormat
|
Back to the Checkstyle Home Page | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |