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

Quick Search    Search Deep

com.puppycrawl.tools.checkstyle.bcel.checks
Class AbstractReferenceCheck  view AbstractReferenceCheck download AbstractReferenceCheck.java

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.api.AutomaticBean
      extended bycom.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
          extended bycom.puppycrawl.tools.checkstyle.bcel.AbstractCheckVisitor
              extended bycom.puppycrawl.tools.checkstyle.bcel.checks.AbstractReferenceCheck
All Implemented Interfaces:
com.puppycrawl.tools.checkstyle.api.Configurable, com.puppycrawl.tools.checkstyle.api.Contextualizable, com.puppycrawl.tools.checkstyle.bcel.IObjectSetVisitor
Direct Known Subclasses:
UnreadFieldCheck, UnusedMethodCheck

public abstract class AbstractReferenceCheck
extends com.puppycrawl.tools.checkstyle.bcel.AbstractCheckVisitor

Abstract class for checks that require reference information.


Field Summary
private  org.apache.regexp.RE mIgnoreClassNameRegexp
          the regexp to match class names against
private  org.apache.regexp.RE mIgnoreNameRegexp
          the regexp to match names against
private  com.puppycrawl.tools.checkstyle.api.Scope mScope
          the scope for recorded references
 
Fields inherited from class com.puppycrawl.tools.checkstyle.bcel.AbstractCheckVisitor
 
Fields inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
 
Fields inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
 
Constructor Summary
AbstractReferenceCheck()
          Creates a AbstractReferenceCheck.
 
Method Summary
private  boolean equalScope(org.apache.bcel.classfile.FieldOrMethod aFieldOrMethod)
          Tests whether the scope of a field or method is compatible with the scope of this check.
protected  com.puppycrawl.tools.checkstyle.bcel.classfile.JavaClassDefinition findJavaClassDef(org.apache.bcel.classfile.JavaClass aJavaClass)
          Finds a JavaClassDefinition for a JavaClass.
 com.puppycrawl.tools.checkstyle.bcel.classfile.ReferenceDAO getReferenceDAO()
          Gets the DAO that manages references for this check.
 com.puppycrawl.tools.checkstyle.bcel.IDeepVisitor getVisitor()
          Gets the deep BCEL visitor.
protected  boolean ignore(java.lang.String aClassName, org.apache.bcel.classfile.FieldOrMethod aFieldOrMethod)
          Determines whether a class name, and field or method should be ignored.
 void setIgnoreClassName(java.lang.String aFormat)
          Set the ignore class name to the specified regular expression.
 void setIgnoreName(java.lang.String aFormat)
          Set the ignore name format to the specified regular expression.
 void setScope(java.lang.String aScopeName)
          Sets the scope for recorded references.
 
Methods inherited from class com.puppycrawl.tools.checkstyle.bcel.AbstractCheckVisitor
destroy, getClassFileVisitor, getGenericVisitor, init, leaveObject, leaveSet, log, log, setMessages, visitObject, visitSet
 
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

mScope

private com.puppycrawl.tools.checkstyle.api.Scope mScope
the scope for recorded references


mIgnoreClassNameRegexp

private org.apache.regexp.RE mIgnoreClassNameRegexp
the regexp to match class names against


mIgnoreNameRegexp

private org.apache.regexp.RE mIgnoreNameRegexp
the regexp to match names against

Constructor Detail

AbstractReferenceCheck

public AbstractReferenceCheck()
Creates a AbstractReferenceCheck.

Method Detail

setScope

public void setScope(java.lang.String aScopeName)
Sets the scope for recorded references.


ignore

protected boolean ignore(java.lang.String aClassName,
                         org.apache.bcel.classfile.FieldOrMethod aFieldOrMethod)
Determines whether a class name, and field or method should be ignored.


equalScope

private boolean equalScope(org.apache.bcel.classfile.FieldOrMethod aFieldOrMethod)
Tests whether the scope of a field or method is compatible with the scope of this check. References for compatible fields or methods should be checked.


setIgnoreClassName

public void setIgnoreClassName(java.lang.String aFormat)
                        throws org.apache.commons.beanutils.ConversionException
Set the ignore class name to the specified regular expression.


setIgnoreName

public void setIgnoreName(java.lang.String aFormat)
                   throws org.apache.commons.beanutils.ConversionException
Set the ignore name format to the specified regular expression.


getVisitor

public com.puppycrawl.tools.checkstyle.bcel.IDeepVisitor getVisitor()
Description copied from class: com.puppycrawl.tools.checkstyle.bcel.AbstractCheckVisitor
Gets the deep BCEL visitor.


getReferenceDAO

public com.puppycrawl.tools.checkstyle.bcel.classfile.ReferenceDAO getReferenceDAO()
Gets the DAO that manages references for this check.


findJavaClassDef

protected com.puppycrawl.tools.checkstyle.bcel.classfile.JavaClassDefinition findJavaClassDef(org.apache.bcel.classfile.JavaClass aJavaClass)
Finds a JavaClassDefinition for a JavaClass.