Class ClassVisitor

java.lang.Object
dxt.scanpath.v1.support.ClassVisitor
Direct Known Subclasses:
ClassAnnotationVisitor, FieldAnnotationVisitor, InheritanceVisitor, MethodAnnotationVisitor

public abstract class ClassVisitor extends Object
Defines a visitor that inspects one class file at a time for specific inheritance and annotation constructs. Subclasses should provide an implementation for the visit(String) method.
Author:
indroneel
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected javassist.ClassPool
    The shared Javassist ClassPool instance that is used to obtain the class definition for a fully qualified name.
    protected MetaStore
    The shared MetaStore instance that is used to store associations discovered during the visitation of classes.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    setClassPool(javassist.ClassPool cp)
    Sets the shared Javassist ClassPool for this visitor.
    final void
    Sets the common MetaStore for this visitor.
    abstract void
    visit(String fqcn)
    Visits a class given its fully qualified class name (FQCN).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • metaStore

      protected MetaStore metaStore
      The shared MetaStore instance that is used to store associations discovered during the visitation of classes.
    • clsPool

      protected javassist.ClassPool clsPool
      The shared Javassist ClassPool instance that is used to obtain the class definition for a fully qualified name.
  • Constructor Details

    • ClassVisitor

      public ClassVisitor()
  • Method Details

    • setMetaStore

      public final void setMetaStore(MetaStore store)
      Sets the common MetaStore for this visitor.
      Parameters:
      store - the MetaStore to be set
    • setClassPool

      public final void setClassPool(javassist.ClassPool cp)
      Sets the shared Javassist ClassPool for this visitor. The classpool is used to obtain the class definition for a fully qualified name.
      Parameters:
      cp - the ClassPool to be set
    • visit

      public abstract void visit(String fqcn)
      Visits a class given its fully qualified class name (FQCN). Subclasses should implement this method to define the specific behavior when a class is visited. This behavior is usually to update the shared metastore with associations for the given class.
      Parameters:
      fqcn - the fully qualified name of the class to visit