|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgap.util.PluginDiscoverer
public class PluginDiscoverer
This class will (slightly inefficiently) look for all classes that implement a particular interface. It is useful for plugins. This is done by looking through the contents of all jar files in the classpath, as well as performing a recursive search for *.class files in the classpath directories This particular class may not work in restrictive ClassLoader environments such as Applets or WebStart. (It may...but unlikely and untested.)
| Nested Class Summary | |
|---|---|
class |
PluginDiscoverer.ClassFilter
Filter that only matches class files |
class |
PluginDiscoverer.DirectoryFilter
Filter that only matches subdirectories |
| Constructor Summary | |
|---|---|
PluginDiscoverer()
Reads the list of jars and classpath folders into instance variables for later (cached) access. |
|
PluginDiscoverer(java.lang.String a_jarFile)
Prepares the discoverer for a single jar file |
|
| Method Summary | |
|---|---|
java.util.List |
findImplementingClasses(java.lang.Class a_intrface)
Finds all classes implementing the given interface |
java.util.List |
findImplementingClasses(java.lang.Class a_intrface,
java.lang.String a_base,
java.lang.String a_path)
Finds all classes implementing the given interface within a given directory. |
java.util.List |
findImplementingClasses(java.lang.String a_fullInterfaceName)
Finds all classes implementing the given interface |
static void |
main(java.lang.String[] args)
For testing purpose |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PluginDiscoverer()
public PluginDiscoverer(java.lang.String a_jarFile)
a_jarFile - String| Method Detail |
|---|
public java.util.List findImplementingClasses(java.lang.String a_fullInterfaceName)
throws java.lang.ClassNotFoundException
a_fullInterfaceName - name of the interface (inclusive package name)
to find implementing classes (not abstract) for
java.lang.ClassNotFoundExceptionpublic java.util.List findImplementingClasses(java.lang.Class a_intrface)
a_intrface - the interface to check against
public java.util.List findImplementingClasses(java.lang.Class a_intrface,
java.lang.String a_base,
java.lang.String a_path)
a_intrface - Classa_base - Stringa_path - String
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - not used
java.lang.Exception - in case of any problem
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||