public class ClassDiscovery extends java.lang.Object implements RevisionHandler
ClassDiscovery.StringCompare
Modifier and Type | Class and Description |
---|---|
static class |
ClassDiscovery.StringCompare
compares two strings.
|
Modifier and Type | Field and Description |
---|---|
static boolean |
VERBOSE
whether to output some debug information.
|
Constructor and Description |
---|
ClassDiscovery() |
Modifier and Type | Method and Description |
---|---|
static void |
clearCache()
clears the cache for class/classnames queries.
|
static void |
clearClassCache()
Calls clearCache() and resets the cache of classes on the classpath (i.e.
|
static java.util.Vector<java.lang.String> |
find(java.lang.Class<?> cls,
java.lang.String pkgname)
Checks the given package for classes that inherited from the given class,
in case it's a class, or implement this class, in case it's an interface.
|
static java.util.Vector<java.lang.String> |
find(java.lang.Class<?> cls,
java.lang.String[] pkgnames)
Checks the given packages for classes that inherited from the given class,
in case it's a class, or implement this class, in case it's an interface.
|
static java.util.ArrayList<java.lang.String> |
find(java.lang.String matchText)
Find all classes that have the supplied matchText String in their suffix.
|
static java.util.Vector<java.lang.String> |
find(java.lang.String classname,
java.lang.String pkgname)
Checks the given package for classes that inherited from the given class,
in case it's a class, or implement this class, in case it's an interface.
|
static java.util.Vector<java.lang.String> |
find(java.lang.String classname,
java.lang.String[] pkgnames)
Checks the given packages for classes that inherited from the given class,
in case it's a class, or implement this class, in case it's an interface.
|
static java.util.Vector<java.lang.String> |
findPackages()
Lists all packages it can find in the classpath.
|
java.lang.String |
getRevision()
Returns the revision string.
|
static void |
main(java.lang.String[] args)
Possible calls:
weka.core.ClassDiscovery <packages>
Prints all the packages in the current classpath weka.core.ClassDiscovery <classname> <packagename(s)> Prints the classes it found. |
public static final boolean VERBOSE
public static java.util.Vector<java.lang.String> find(java.lang.String classname, java.lang.String[] pkgnames)
classname
- the class/interface to look forpkgnames
- the packages to search inpublic static java.util.Vector<java.lang.String> find(java.lang.String classname, java.lang.String pkgname)
classname
- the class/interface to look forpkgname
- the package to search inpublic static java.util.Vector<java.lang.String> find(java.lang.Class<?> cls, java.lang.String[] pkgnames)
cls
- the class/interface to look forpkgnames
- the packages to search inpublic static java.util.ArrayList<java.lang.String> find(java.lang.String matchText)
matchText
- the text to matchpublic static java.util.Vector<java.lang.String> find(java.lang.Class<?> cls, java.lang.String pkgname)
cls
- the class/interface to look forpkgname
- the package to search inpublic static java.util.Vector<java.lang.String> findPackages()
public static void clearCache()
public static void clearClassCache()
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
public static void main(java.lang.String[] args)
args
- the commandline arguments