Modifier and Type | Method and Description |
---|---|
Class<?> |
getClass(String classname)
Returns the Class object for the class with the specified name.
|
static PluginLoader |
instance()
Returns a reference to the single instance.
|
Iterator<Plugin> |
iterator() |
void |
loadPlugins(File pluginDirectory)
Loads plug-ins from one directory
|
void |
loadPlugins(File[] pluginDirectories)
Loads plug-ins from one or more directories
|
Object |
newInstance(String classname,
Class<?>[] argTypes,
Object[] args)
Creates a new instance of a class within one of the plug-ins
|
String |
toString() |
public static PluginLoader instance()
public void loadPlugins(File pluginDirectory) throws MaltChainedException
pluginDirectory
- The directory that contains all plug-insMaltChainedException
public void loadPlugins(File[] pluginDirectories) throws MaltChainedException
pluginDirectories
- An array of directories that contains all plug-insMaltChainedException
public Class<?> getClass(String classname)
classname
- the fully qualified name of the desired classpublic Object newInstance(String classname, Class<?>[] argTypes, Object[] args) throws MaltChainedException
classname
- The fully qualified name of the desired classargTypes
- An array of classes (fully qualified name) that specify the arguments to the constructorargs
- An array of objects that will be the actual parameters to the constructor (the type should corresponds to the argTypes).MaltChainedException
Copyright 2007-2014 Johan Hall, Jens Nilsson and Joakim Nivre.