MaltParser 1.0.1

org.maltparser.core.plugin
Class PluginLoader

java.lang.Object
  extended by org.maltparser.core.plugin.PluginLoader

public class PluginLoader
extends Object

Loads MaltParser plug-ins and makes new instances of classes within these plug-ins.

Since:
1.0
Author:
Johan Hall

Constructor Summary
PluginLoader()
          Creates a PluginLoader
 
Method Summary
 Class<?> getClass(String classname)
          Returns the Class object for the class with the specified name.
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginLoader

public PluginLoader()
Creates a PluginLoader

Throws:
PluginException
Method Detail

loadPlugins

public void loadPlugins(File pluginDirectory)
                 throws MaltChainedException
Loads plug-ins from one directory

Parameters:
pluginDirectory - The directory that contains all plug-ins
Throws:
MaltChainedException

loadPlugins

public void loadPlugins(File[] pluginDirectories)
                 throws MaltChainedException
Loads plug-ins from one or more directories

Parameters:
pluginDirectories - An array of directories that contains all plug-ins
Throws:
MaltChainedException

getClass

public Class<?> getClass(String classname)
Returns the Class object for the class with the specified name.

Parameters:
classname - the fully qualified name of the desired class
Returns:
the Class object for the class with the specified name.

newInstance

public Object newInstance(String classname,
                          Class<?>[] argTypes,
                          Object[] args)
                   throws MaltChainedException
Creates a new instance of a class within one of the plug-ins

Parameters:
classname - The fully qualified name of the desired class
argTypes - An array of classes (fully qualified name) that specify the arguments to the constructor
args - An array of objects that will be the actual parameters to the constructor (the type should corresponds to the argTypes).
Returns:
a reference to the created instance.
Throws:
MaltChainedException

MaltParser 1.0.1

Copyright 2007 Johan Hall, Jens Nilsson and Joakim Nivre.