javatools.util
Class PluginLoader

java.lang.Object
  |
  +--javatools.util.PluginLoader

public class PluginLoader
extends java.lang.Object

Wow loads a list of plugins!


Constructor Summary
PluginLoader(java.util.Properties props)
          Loads plugins from a properties object.
 
Method Summary
 java.util.List loadClasses(java.lang.String propertyName)
          Loads the classes and returns them as a list.
 java.util.List loadInstances(java.lang.String propertyName)
          Returns instances of classes contained in a property object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginLoader

public PluginLoader(java.util.Properties props)
Loads plugins from a properties object.

Parameters:
props - The properties object to use. Each property must contains a list of classes, separated by a comma, a space or a TAB.
Method Detail

loadClasses

public java.util.List loadClasses(java.lang.String propertyName)
                           throws java.lang.ClassNotFoundException
Loads the classes and returns them as a list.

Parameters:
propertyName - The property key to use.
Returns:
The list of classes.
Throws:
java.lang.ClassNotFoundException - If a class cannot be found.

loadInstances

public java.util.List loadInstances(java.lang.String propertyName)
                             throws java.lang.ClassNotFoundException,
                                    java.lang.IllegalAccessException,
                                    java.lang.InstantiationException
Returns instances of classes contained in a property object.

Parameters:
propertyName - The property to use to get classes from.
Returns:
The list of instance of these classes.
Throws:
java.lang.ClassNotFoundException - If a class cannot be found.
java.lang.IllegalAccessException - If an illegal access has been made.
java.lang.InstantiationException - If the class cannot be instantiated.