public class JavaSourceCollector extends Object implements SourceCollector
| Constructor and Description |
|---|
JavaSourceCollector(File startDirectory)
Creates a new source collector.
|
JavaSourceCollector(File startDirectory,
String packageName)
Creates a new source collector.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIgnoredBaseClass(Class baseClass)
Adds a class to the list of ignored base classes.
|
void |
addIgnoredBaseClass(String baseClass)
Adds a base class that should be ignored.
|
void |
addIgnoredPackage(String pkg)
Adds a package that should be ignored.
|
protected String |
buildJavaName(String packageName,
String newPackage)
Creates a fully qualified Java class or package name.
|
void |
collectFiles()
Collects the files/classes.
|
protected void |
collectFiles(File directory,
String packageName)
Collects the files/classes.
|
Class[] |
getClasses()
Returns the list of classes as an array.
|
protected boolean |
isIgnoredBaseClass(Class c)
Returns
true if the named class is being ignored (because it is a descendant
of an ignored base class), and false otherwise. |
protected boolean |
isIgnoredPackage(String classname)
Returns
true if the named class is being ignored (because of the package that
it belongs to), and false otherwise. |
protected Class |
loadClass(String name)
Loads a class by its fully qualified name.
|
public JavaSourceCollector(File startDirectory)
startDirectory - the start directory.public void addIgnoredPackage(String pkg)
pkg - the package name.public void addIgnoredBaseClass(String baseClass)
baseClass - the base class name.public void addIgnoredBaseClass(Class baseClass)
baseClass - the class.protected boolean isIgnoredPackage(String classname)
true if the named class is being ignored (because of the package that
it belongs to), and false otherwise.classname - the name of the class to test.protected boolean isIgnoredBaseClass(Class c)
true if the named class is being ignored (because it is a descendant
of an ignored base class), and false otherwise.c - the class name.public void collectFiles()
protected void collectFiles(File directory, String packageName)
directory - the starting directory.packageName - the initial package name.protected Class loadClass(String name)
name - the class name.null if there was a problem loading the class).protected String buildJavaName(String packageName, String newPackage)
packageName - the base package name.newPackage - the class/package name.public Class[] getClasses()
getClasses in interface SourceCollectorCopyright © 2009-2012 jtstand.com. All Rights Reserved.