com.puppycrawl.tools.checkstyle.api
public abstract class Check extends AbstractViolationReporter
Version: 1.0
UNKNOWN: Writing your own checks
| 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.
|
| 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 | 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 aLine, String aKey, Object[] aArgs)
Log an error message.
|
| protected void | log(int aLineNo, int aColNo, String aKey, Object[] aArgs)
Helper method to log a LocalizedMessage.
|
| 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. |
Parameters: aRootAST the root of the tree
Parameters: aRootAST the root of the tree
Returns: the token set this check is designed for.
See Also: TokenTypes
Returns: the class loader
Returns: the default tokens
See Also: TokenTypes
Returns: the file contents
Returns: the file contents
Returns: the token set this must be registered for.
See Also: TokenTypes
Returns: the tab width to report errors with
Returns: the set of token names
Parameters: aAST the token leaving
Parameters: aLine the line number where the error was found aKey the message that describes the error aArgs the details of the message
See Also: java.text.MessageFormat
Parameters: aLineNo line number to associate with the message aColNo column number to associate with the message aKey key to locale message format aArgs arguments for message
Parameters: aLoader the class loader
Parameters: aContents the manager
Parameters: aMessages the messages to log with
Parameters: aTabWidth an int value
Parameters: aStrRep the string representation of the tokens interested in
Parameters: aAST the token to process