jaige.util
Class PluginLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by jaige.util.PluginLoader

public class PluginLoader
extends java.lang.ClassLoader

Title:

Description:

Copyright: Copyright (c) 2004

Company:

Version:
1.0
Author:
Rob Taft

Method Summary
static
<T> java.lang.Class<T>[]
getPluginClasses(java.lang.Class<T> baseClass)
          Searches for classes that extend the base class, and returns them.
static
<T> java.util.List<T>
getPlugins(java.lang.Class<T> baseClass)
          Searches for classes that extend the base class, and attempts to construct an instance of each class found.
static void loadPlugins()
           
static boolean setPluginDirctory(java.lang.String directory)
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setPluginDirctory

public static boolean setPluginDirctory(java.lang.String directory)

getPluginClasses

public static <T> java.lang.Class<T>[] getPluginClasses(java.lang.Class<T> baseClass)
Searches for classes that extend the base class, and returns them.

Parameters:
baseClass - Class The parent class or interface of the classes we wish to find.
Returns:
Class[] Classes that implement the base class.

getPlugins

public static <T> java.util.List<T> getPlugins(java.lang.Class<T> baseClass)
Searches for classes that extend the base class, and attempts to construct an instance of each class found.

Parameters:
baseClass - Class The parent class or interface of the classes we wish to find.
Returns:
Object[] Instances of each base class.

loadPlugins

public static void loadPlugins()