public abstract class AbstractAnalyzer extends Object implements DependencyAnalyzer
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_LOOPS
Maximum number of loops for looking for indirect dependencies.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAnalyzer()
Setup the analyzer
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClassPath(Path classPath)
Add a classpath to the classpath being used by the analyzer.
|
void |
addRootClass(String className)
Add a root class.
|
void |
addSourcePath(Path sourcePath)
Add a source path to the source path used by this analyzer.
|
void |
config(String name,
Object info)
Configure an aspect of the analyzer.
|
protected abstract void |
determineDependencies(Vector<File> files,
Vector<String> classes)
Determine the dependencies of the current set of root classes
|
File |
getClassContainer(String classname)
Get the file that contains the class definition
|
Enumeration<String> |
getClassDependencies()
Get the list of classes upon which root classes depend.
|
Enumeration<File> |
getFileDependencies()
Get the list of files in the file system upon which the root classes
depend.
|
protected Enumeration<String> |
getRootClasses()
Get an enumeration of the root classes
|
File |
getSourceContainer(String classname)
Get the file that contains the class source.
|
protected boolean |
isClosureRequired()
Indicate if the analyzer is required to follow
indirect class relationships.
|
void |
reset()
Reset the dependency list.
|
void |
setClosure(boolean closure)
Set the closure flag.
|
protected abstract boolean |
supportsFileDependencies()
Indicate if the particular subclass supports file dependency
information.
|
public static final int MAX_LOOPS
public void addClassPath(Path classPath)
addClassPath in interface DependencyAnalyzerclassPath - the Path instance specifying the classpath elementspublic void addRootClass(String className)
addRootClass in interface DependencyAnalyzerclassName - the name of the class in Java dot notation.public void addSourcePath(Path sourcePath)
addSourcePath in interface DependencyAnalyzersourcePath - The Path instance specifying the source path
elements.public void config(String name, Object info)
config in interface DependencyAnalyzername - the name of the aspect being configuredinfo - the configuration info.protected abstract void determineDependencies(Vector<File> files, Vector<String> classes)
files - a vector into which Files upon which the root classes
depend should be placed.classes - a vector of Strings into which the names of classes
upon which the root classes depend should be placed.public File getClassContainer(String classname) throws IOException
getClassContainer in interface DependencyAnalyzerclassname - the name of the required classIOException - if the files in the classpath cannot be read.public Enumeration<String> getClassDependencies()
getClassDependencies in interface DependencyAnalyzerpublic Enumeration<File> getFileDependencies()
getFileDependencies in interface DependencyAnalyzerprotected Enumeration<String> getRootClasses()
public File getSourceContainer(String classname) throws IOException
getSourceContainer in interface DependencyAnalyzerclassname - the name of the required classIOException - if the files in the sourcepath cannot be read.protected boolean isClosureRequired()
public void reset()
reset in interface DependencyAnalyzerpublic void setClosure(boolean closure)
setClosure in interface DependencyAnalyzerclosure - true if dependencies should be traversed to determine
indirect dependencies.protected abstract boolean supportsFileDependencies()