public abstract class Check extends AbstractViolationReporter
| Constructor and Description |
|---|
Check() |
| Modifier and Type | Method and Description |
|---|---|
void |
beginTree(DetailAST rootAST)
Called before the starting to process a tree.
|
void |
destroy()
Destroy the check.
|
void |
finishTree(DetailAST rootAST)
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 |
getLine(int index)
Returns the line 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.
|
boolean |
isCommentNodesRequired() |
void |
leaveToken(DetailAST ast)
Called after all the child nodes have been process.
|
void |
log(int lineNo,
int colNo,
String key,
Object... args)
Log a message that has column information.
|
void |
log(int line,
String key,
Object... args)
Log a message that has no column information.
|
void |
setClassLoader(ClassLoader loader)
Set the class loader associated with the tree.
|
void |
setFileContents(FileContents contents)
Set the file contents associated with the tree.
|
void |
setMessages(LocalizedMessages messages)
Set the global object used to collect messages.
|
void |
setTabWidth(int tabWidth)
Set the tab width to report errors with.
|
void |
setTokens(String[] strRep)
Adds a set of tokens the check is interested in.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic Check()
public boolean isCommentNodesRequired()
public abstract int[] getDefaultTokens()
TokenTypespublic int[] getAcceptableTokens()
TokenTypespublic int[] getRequiredTokens()
TokenTypespublic final void setTokens(String[] strRep)
strRep - the string representation of the tokens interested inpublic final Set<String> getTokenNames()
public final void setMessages(LocalizedMessages messages)
messages - the messages to log withpublic void init()
public void destroy()
public void beginTree(DetailAST rootAST)
rootAST - the root of the treepublic void finishTree(DetailAST rootAST)
rootAST - the root of the treepublic void visitToken(DetailAST ast)
ast - the token to processpublic void leaveToken(DetailAST ast)
ast - the token leavingpublic final String[] getLines()
public final String getLine(int index)
index - index of the linepublic final void setFileContents(FileContents contents)
contents - the managerpublic final FileContents getFileContents()
public final void setClassLoader(ClassLoader loader)
loader - the class loaderpublic final ClassLoader getClassLoader()
protected final int getTabWidth()
public final void setTabWidth(int tabWidth)
tabWidth - an int valuepublic final void log(int line, String key, Object... args)
AbstractViolationReporterlog in class AbstractViolationReporterline - the line number where the error was foundkey - the message that describes the errorargs - the details of the messageMessageFormatpublic final void log(int lineNo, int colNo, String key, Object... args)
AbstractViolationReporterlog in class AbstractViolationReporterlineNo - the line number where the error was foundcolNo - the column number where the error was foundkey - the message that describes the errorargs - the details of the messageMessageFormatCopyright © 2001–2015. All rights reserved.