Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.puppycrawl.tools.checkstyle.checks.usage
Class AbstractUsageCheck  view AbstractUsageCheck download AbstractUsageCheck.java

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.api.AutomaticBean
      extended bycom.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
          extended bycom.puppycrawl.tools.checkstyle.api.Check
              extended bycom.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.


Field Summary
private  java.lang.String mIgnoreFormat
          the format string of the regexp
private  org.apache.regexp.RE mRegexp
          the regexp to match against
 
Fields inherited from class com.puppycrawl.tools.checkstyle.api.Check
 
Fields inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
 
Fields inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
 
Constructor Summary
AbstractUsageCheck()
          Constructs an AbstractUsageCheck.
 
Method Summary
 void applyTo(java.util.Set aNodes)
          Applies this check to a set of nodes.
 void beginTree(com.puppycrawl.tools.checkstyle.api.DetailAST aRootAST)
          Called before the starting to process a tree.
 void finishTree(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
          Called after finished processing a tree.
protected  com.puppycrawl.tools.checkstyle.checks.usage.transmogrify.ASTManager getASTManager()
          Gets the manager for AST nodes.
abstract  java.lang.String getErrorKey()
          Returns the key for the Checkstyle error message.
 java.lang.String getIgnoreFormat()
           
private  int getReferenceCount(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
          Determines the reference count for a DetailAST.
 org.apache.regexp.RE getRegexp()
           
 void logError(java.lang.Exception aException)
          Logs an exception.
abstract  boolean mustCheckReferenceCount(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
          Determines whether the reference count of an aAST is required.
 void setIgnoreFormat(java.lang.String aFormat)
          Set the ignore format to the specified regular expression.
 void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
          Called to process a token.
 
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 com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
getMessageBundle, getSeverity, getSeverityLevel, 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
 

Field Detail

mRegexp

private org.apache.regexp.RE mRegexp
the regexp to match against


mIgnoreFormat

private java.lang.String mIgnoreFormat
the format string of the regexp

Constructor Detail

AbstractUsageCheck

public AbstractUsageCheck()
Constructs an AbstractUsageCheck.

Method Detail

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.