|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ninjasoft.magiccodes.logic.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
File.listFiles filter that only matches class files |
class |
PluginDiscoverer.directoryFilter
File.listFiles filter that only matches subdirectories |
Constructor Summary | |
PluginDiscoverer()
Construct the object and parse apart the classpath into directories and jars. |
Method Summary | |
java.lang.String[] |
findMatchingPlugins(java.lang.Class c)
Find all classes in the class path that implement the interface defined in the Class object parameter. |
static void |
main(java.lang.String[] argv)
Simple main function for testing |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PluginDiscoverer()
Method Detail |
public java.lang.String[] findMatchingPlugins(java.lang.Class c)
c
- a Class object representing the interface we are looking for
public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- unused
java.lang.Exception
- if there was a problem
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |