|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jeantessier.classreader.VisitorBase | +--com.jeantessier.dependency.CodeDependencyCollector
Traverses a Classfile and extracts dependencies from its code. Does not see dependencies on static final simple constants (basic type or String) and does not look at local variables.
Constructor Summary | |
CodeDependencyCollector()
|
|
CodeDependencyCollector(NodeFactory factory)
|
Method Summary | |
void |
addDependencyListener(DependencyListener listener)
|
void |
BeginClassfile(LoadEvent event)
The loader is starting on a new .class
file. |
void |
BeginFile(LoadEvent event)
The loader is starting on a new file. |
void |
BeginGroup(LoadEvent event)
The loader is starting on a new group of files. |
void |
BeginSession(LoadEvent event)
|
java.util.Collection |
Collection()
|
void |
EndClassfile(LoadEvent event)
The loader is finished loading a .class
file. |
void |
EndFile(LoadEvent event)
The loader is finished with a file. |
void |
EndGroup(LoadEvent event)
The loader finished the group of files. |
void |
EndSession(LoadEvent event)
|
NodeFactory |
Factory()
|
protected void |
fireBeginClass(java.lang.String classname)
|
protected void |
fireBeginSession()
|
protected void |
fireDependency(Node dependent,
Node dependable)
|
protected void |
fireEndClass(java.lang.String classname)
|
protected void |
fireEndSession()
|
void |
removeDependencyListener(DependencyListener listener)
|
void |
VisitClass_info(Class_info entry)
|
void |
VisitClassfile(Classfile classfile)
|
void |
VisitCode_attribute(Code_attribute attribute)
|
void |
VisitExceptionHandler(ExceptionHandler helper)
|
void |
VisitField_info(Field_info entry)
|
void |
VisitFieldRef_info(FieldRef_info entry)
|
void |
VisitInterfaceMethodRef_info(InterfaceMethodRef_info entry)
|
void |
VisitMethod_info(Method_info entry)
|
void |
VisitMethodRef_info(MethodRef_info entry)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CodeDependencyCollector()
public CodeDependencyCollector(NodeFactory factory)
Method Detail |
public NodeFactory Factory()
public java.util.Collection Collection()
Collection
in interface Collector
public void VisitClassfile(Classfile classfile)
VisitClassfile
in interface Visitor
VisitClassfile
in class VisitorBase
public void VisitClass_info(Class_info entry)
VisitClass_info
in interface Visitor
VisitClass_info
in class VisitorBase
public void VisitFieldRef_info(FieldRef_info entry)
VisitFieldRef_info
in interface Visitor
VisitFieldRef_info
in class VisitorBase
public void VisitMethodRef_info(MethodRef_info entry)
VisitMethodRef_info
in interface Visitor
VisitMethodRef_info
in class VisitorBase
public void VisitInterfaceMethodRef_info(InterfaceMethodRef_info entry)
VisitInterfaceMethodRef_info
in interface Visitor
VisitInterfaceMethodRef_info
in class VisitorBase
public void VisitField_info(Field_info entry)
VisitField_info
in interface Visitor
VisitField_info
in class VisitorBase
public void VisitMethod_info(Method_info entry)
VisitMethod_info
in interface Visitor
VisitMethod_info
in class VisitorBase
public void VisitCode_attribute(Code_attribute attribute)
VisitCode_attribute
in interface Visitor
VisitCode_attribute
in class VisitorBase
public void VisitExceptionHandler(ExceptionHandler helper)
VisitExceptionHandler
in interface Visitor
VisitExceptionHandler
in class VisitorBase
public void addDependencyListener(DependencyListener listener)
public void removeDependencyListener(DependencyListener listener)
protected void fireBeginSession()
protected void fireBeginClass(java.lang.String classname)
protected void fireDependency(Node dependent, Node dependable)
protected void fireEndClass(java.lang.String classname)
protected void fireEndSession()
public void BeginSession(LoadEvent event)
BeginSession
in interface LoadListener
public void BeginGroup(LoadEvent event)
LoadListener
The loader is starting on a new group of files.
For example, this can be a new JAR file or a
collection of loose .class
files.
The event's filename attribute points to the source or the group of files, such as the JAR file's name or the root directory of the loose files.
The element and classfile attributes are null.
BeginGroup
in interface LoadListener
public void BeginClassfile(LoadEvent event)
LoadListener
The loader is starting on a new .class
file.
The event's element attribute contains the name of
the .class
file being processed.
The event's filename attribute points to the group of files that contains the current file. For example, the JAR file's name or the root directory of loose files.
The classfile attribute is null.
BeginClassfile
in interface LoadListener
public void BeginFile(LoadEvent event)
LoadListener
The loader is starting on a new file.
The event's element attribute contains the name of the file being processed.
The event's filename attribute points to the group of files that contains the current file. For example, the JAR file's name or the root directory of loose files.
The classfile attribute is null.
BeginFile
in interface LoadListener
public void EndClassfile(LoadEvent event)
LoadListener
The loader is finished loading a .class
file.
The event's classfile attribute contains the newly
loaded Classfile instance from the .class
file.
The event's filename attribute points to the group of files that contains the current file. For example, the JAR file's name or the root directory of loose files.
The element attribute is null.
EndClassfile
in interface LoadListener
public void EndFile(LoadEvent event)
LoadListener
The loader is finished with a file.
The event's element attribute contains the name of the file being processed.
The event's filename attribute points to the group of files that contains the current file. For example, the JAR file's name or the root directory of loose files.
The event's classfile attribute may contains a newly loaded Classfile instance from the file.
EndFile
in interface LoadListener
public void EndGroup(LoadEvent event)
LoadListener
The loader finished the group of files. For
example, this can be a new JAR file or a
collection of loose .class
files.
The event's filename attribute points to the source or the group of files, such as the JAR file's name or the root directory of the loose files.
The element and classfile attributes are null.
EndGroup
in interface LoadListener
public void EndSession(LoadEvent event)
EndSession
in interface LoadListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |