Methods Summary |
---|
public void | addDefaultExcludes()
|
public java.lang.String[] | getExcludedDirectories(){@inheritDoc}.
return null;
|
public java.lang.String[] | getExcludedFiles(){@inheritDoc}.
return null;
|
public java.lang.String[] | getIncludedDirectories(){@inheritDoc}.
return new String[0];
|
public int | getIncludedDirsCount(){@inheritDoc}.
return 0;
|
public java.lang.String[] | getIncludedFiles()Get the names of the class files on which baseClass depends.
String[] files = new String[getIncludedFilesCount()];
for (int i = 0; i < files.length; i++) {
files[i] = (String) included.elementAt(i);
}
return files;
|
public synchronized int | getIncludedFilesCount(){@inheritDoc}.
if (included == null) {
throw new IllegalStateException();
}
return included.size();
|
public java.lang.String[] | getNotIncludedDirectories(){@inheritDoc}.
return null;
|
public java.lang.String[] | getNotIncludedFiles(){@inheritDoc}.
return null;
|
public synchronized void | scan()Scans the base directory for files on which baseClass depends.
included = new Vector();
String analyzerClassName = DEFAULT_ANALYZER_CLASS;
DependencyAnalyzer analyzer = null;
try {
Class analyzerClass = Class.forName(analyzerClassName);
analyzer = (DependencyAnalyzer) analyzerClass.newInstance();
} catch (Exception e) {
throw new BuildException("Unable to load dependency analyzer: "
+ analyzerClassName, e);
}
analyzer.addClassPath(new Path(null, basedir.getPath()));
for (Enumeration e = rootClasses.elements(); e.hasMoreElements();) {
String rootClass = (String) e.nextElement();
analyzer.addRootClass(rootClass);
}
Enumeration e = analyzer.getClassDependencies();
String[] parentFiles = parentScanner.getIncludedFiles();
Hashtable parentSet = new Hashtable();
for (int i = 0; i < parentFiles.length; ++i) {
parentSet.put(parentFiles[i], parentFiles[i]);
}
while (e.hasMoreElements()) {
String classname = (String) e.nextElement();
String filename = classname.replace('.", File.separatorChar);
filename = filename + ".class";
File depFile = new File(basedir, filename);
if (depFile.exists() && parentSet.containsKey(filename)) {
// This is included
included.addElement(filename);
}
}
|
public void | setCaseSensitive(boolean isCaseSensitive){@inheritDoc}.
|
public void | setExcludes(java.lang.String[] excludes){@inheritDoc}.
|
public void | setIncludes(java.lang.String[] includes){@inheritDoc}.
|
public synchronized void | setRootClasses(java.util.Vector rootClasses)Sets the root classes to be used to drive the scan.
this.rootClasses = rootClasses;
|