public abstract class AbstractAnalyzer extends java.lang.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(java.lang.String className)
Add a root class.
|
void |
addSourcePath(Path sourcePath)
Add a source path to the source path used by this analyzer.
|
void |
config(java.lang.String name,
java.lang.Object info)
Configure an aspect of the analyzer.
|
protected abstract void |
determineDependencies(java.util.Vector<java.io.File> files,
java.util.Vector<java.lang.String> classes)
Determine the dependencies of the current set of root classes
|
java.io.File |
getClassContainer(java.lang.String classname)
Get the file that contains the class definition
|
java.util.Enumeration<java.lang.String> |
getClassDependencies()
Get the list of classes upon which root classes depend.
|
java.util.Enumeration<java.io.File> |
getFileDependencies()
Get the list of files in the file system upon which the root classes
depend.
|
protected java.util.Enumeration<java.lang.String> |
getRootClasses()
Get an enumeration of the root classes
|
java.io.File |
getSourceContainer(java.lang.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 setClosure(boolean closure)
setClosure
in interface DependencyAnalyzer
closure
- true if dependencies should be traversed to determine
indirect dependencies.public java.util.Enumeration<java.io.File> getFileDependencies()
getFileDependencies
in interface DependencyAnalyzer
public java.util.Enumeration<java.lang.String> getClassDependencies()
getClassDependencies
in interface DependencyAnalyzer
public java.io.File getClassContainer(java.lang.String classname) throws java.io.IOException
getClassContainer
in interface DependencyAnalyzer
classname
- the name of the required classjava.io.IOException
- if the files in the classpath cannot be read.public java.io.File getSourceContainer(java.lang.String classname) throws java.io.IOException
getSourceContainer
in interface DependencyAnalyzer
classname
- the name of the required classjava.io.IOException
- if the files in the sourcepath cannot be read.public void addSourcePath(Path sourcePath)
addSourcePath
in interface DependencyAnalyzer
sourcePath
- The Path instance specifying the source path
elements.public void addClassPath(Path classPath)
addClassPath
in interface DependencyAnalyzer
classPath
- the Path instance specifying the classpath elementspublic void addRootClass(java.lang.String className)
addRootClass
in interface DependencyAnalyzer
className
- the name of the class in Java dot notation.public void config(java.lang.String name, java.lang.Object info)
config
in interface DependencyAnalyzer
name
- the name of the aspect being configuredinfo
- the configuration info.public void reset()
reset
in interface DependencyAnalyzer
protected java.util.Enumeration<java.lang.String> getRootClasses()
protected boolean isClosureRequired()
protected abstract void determineDependencies(java.util.Vector<java.io.File> files, java.util.Vector<java.lang.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.protected abstract boolean supportsFileDependencies()