java.lang.Object
com.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
com.puppycrawl.tools.checkstyle.api.Check
com.puppycrawl.tools.checkstyle.checks.usage.AbstractUsageCheck
- All Implemented Interfaces:
- com.puppycrawl.tools.checkstyle.api.Configurable, com.puppycrawl.tools.checkstyle.api.Contextualizable
- Direct Known Subclasses:
- OneMethodPrivateFieldCheck, UnusedLocalVariableCheck, UnusedParameterCheck, UnusedPrivateFieldCheck, UnusedPrivateMethodCheck
- public abstract class AbstractUsageCheck
- extends com.puppycrawl.tools.checkstyle.api.Check
Performs a usage check for fields, methods, parameters, variables.
| Fields inherited from class com.puppycrawl.tools.checkstyle.api.Check |
|
| Fields inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean |
|
| Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check |
destroy, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mRegexp
private org.apache.regexp.RE mRegexp
- the regexp to match against
mIgnoreFormat
private java.lang.String mIgnoreFormat
- the format string of the regexp
AbstractUsageCheck
public AbstractUsageCheck()
- Constructs an
AbstractUsageCheck.
setIgnoreFormat
public void setIgnoreFormat(java.lang.String aFormat)
throws org.apache.commons.beanutils.ConversionException
- Set the ignore format to the specified regular expression.
getRegexp
public org.apache.regexp.RE getRegexp()
getIgnoreFormat
public java.lang.String getIgnoreFormat()
beginTree
public void beginTree(com.puppycrawl.tools.checkstyle.api.DetailAST aRootAST)
- Description copied from class:
com.puppycrawl.tools.checkstyle.api.Check
- Called before the starting to process a tree. Ideal place to initialise
information that is to be collected whilst processing a tree.
visitToken
public void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
- Description copied from class:
com.puppycrawl.tools.checkstyle.api.Check
- Called to process a token.
finishTree
public void finishTree(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
- Description copied from class:
com.puppycrawl.tools.checkstyle.api.Check
- Called after finished processing a tree. Ideal place to report on
information collected whilst processing a tree.
logError
public void logError(java.lang.Exception aException)
- Logs an exception.
getReferenceCount
private int getReferenceCount(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
- Determines the reference count for a DetailAST.
getErrorKey
public abstract java.lang.String getErrorKey()
- Returns the key for the Checkstyle error message.
mustCheckReferenceCount
public abstract boolean mustCheckReferenceCount(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
- Determines whether the reference count of an aAST is required.
applyTo
public void applyTo(java.util.Set aNodes)
- Applies this check to a set of nodes.
getASTManager
protected com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.ASTManager getASTManager()
- Gets the manager for AST nodes.