edu.wisc.cs.stego.modules
Class ModuleLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--edu.wisc.cs.stego.modules.ModuleLoader

public class ModuleLoader
extends java.lang.ClassLoader

This class is the engine which loads and instantiates plugin modules. It loads module classes on demand, and caches instances of the factory methods for future use. This interface hides the user from the uglyness of dealing with the java.lang.reflect classes needed to load and instantiate arbitrary class files.

See Also:
Encoder, Scanner

Method Summary
static CodeEditor loadCodeEditor(java.lang.String classname, java.lang.String[] params)
          Instantiates the desired subclass of CodeEditor.
static Encoder loadEncoder(java.lang.String classname, java.lang.String[] params)
          Instantiates the desired subclass of Encoder.
static Scanner loadScanner(java.lang.String classname, java.lang.String[] params)
          Instantiates the desired subclass of Scanner.
 
Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadEncoder

public static Encoder loadEncoder(java.lang.String classname,
                                  java.lang.String[] params)
                           throws java.lang.Exception
Instantiates the desired subclass of Encoder. If necessary, this method loads and resolves the type. This method may throw MANY different exceptions, all of which are irrecoverable to most programs, assuming that the module being requested is necessary for the successful completion of the program. It may be useful for debugging purposes to print or examine the exception message, which may indicate a problem with the particular implementation of the requested module.

If any of these conditions are not met, this method will throw an appropriate exception.

Parameters:
classname - the fully qualified name of the Encoder subclass.
params - the parameters necessary to initialize the Encoder.
Returns:
an instance of the requested Encoder subclass type.
Throws:
many - exceptions.
See Also:
Encoder

loadCodeEditor

public static CodeEditor loadCodeEditor(java.lang.String classname,
                                        java.lang.String[] params)
                                 throws java.lang.Exception
Instantiates the desired subclass of CodeEditor. If necessary, this method loads and resolves the type. This method may throw MANY different exceptions, all of which are irrecoverable to most programs, assuming that the module being requested is necessary for the successful completion of the program. It may be useful for debugging purposes to print or examine the exception message, which may indicate a problem with the particular implementation of the requested module.

If any of these conditions are not met, this method will throw an appropriate exception.

Parameters:
classname - the fully qualified name of the CodeEditor subclass.
params - the parameters necessary to initialize the CodeEditor.
Returns:
an instance of the requested CodeEditor subclass type.
Throws:
many - exceptions.
See Also:
CodeEditor

loadScanner

public static Scanner loadScanner(java.lang.String classname,
                                  java.lang.String[] params)
                           throws java.lang.Exception
Instantiates the desired subclass of Scanner. If necessary, this method loads and resolves the type. This method may throw MANY different exceptions, all of which are irrecoverable to most programs, assuming that the module being requested is necessary for the successful completion of the program. It may be useful for debugging purposes to print or examine the exception message, which may indicate a problem with the particular implementation of the requested module.

If any of these conditions are not met, this method will throw an appropriate exception.

Parameters:
classname - the fully qualified name of the Scanner subclass.
params - the parameters necessary to initialize the Encoder.
Returns:
an instance of the requested Scanner subclass type.
Throws:
many - exceptions.
See Also:
Scanner