Class ClassVisitor
java.lang.Object
dxt.scanpath.v1.support.ClassVisitor
- Direct Known Subclasses:
ClassAnnotationVisitor, FieldAnnotationVisitor, InheritanceVisitor, MethodAnnotationVisitor
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
FieldsModifier and TypeFieldDescriptionprotected javassist.ClassPoolThe shared JavassistClassPoolinstance that is used to obtain the class definition for a fully qualified name.protected MetaStoreThe sharedMetaStoreinstance that is used to store associations discovered during the visitation of classes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidsetClassPool(javassist.ClassPool cp) Sets the shared JavassistClassPoolfor this visitor.final voidsetMetaStore(MetaStore store) Sets the commonMetaStorefor this visitor.abstract voidVisits a class given its fully qualified class name (FQCN).
-
Field Details
-
metaStore
-
clsPool
protected javassist.ClassPool clsPoolThe shared JavassistClassPoolinstance that is used to obtain the class definition for a fully qualified name.
-
-
Constructor Details
-
ClassVisitor
public ClassVisitor()
-
-
Method Details
-
setMetaStore
-
setClassPool
public final void setClassPool(javassist.ClassPool cp) Sets the shared JavassistClassPoolfor this visitor. The classpool is used to obtain the class definition for a fully qualified name.- Parameters:
cp- theClassPoolto be set
-
visit
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
-