org.oclc.da.gdfr.registryprototype.utils
Class DynamicLoader

java.lang.Object
  extended by org.oclc.da.gdfr.registryprototype.utils.DynamicLoader

public class DynamicLoader
extends java.lang.Object

DynamicLoader A class that handles dynamically loading classes based on a full qualified class name. This class also has the capability of loading classes with constructors.

Author:
JCG

Constructor Summary
DynamicLoader(java.lang.String className)
          Construct a DynamicLoader instance.
 
Method Summary
 java.lang.Object load()
          Load the class using the default constructor.
 java.lang.Object load(java.lang.Class[] classes, java.lang.Object[] args)
          Load an instance of a class using the current class name and the constructor parameters specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicLoader

public DynamicLoader(java.lang.String className)
Construct a DynamicLoader instance.

Parameters:
className - The fully qualified name of the class to load, including the package (e.g. "org.oclc.da.common.GenericRef")
Method Detail

load

public java.lang.Object load()
Load the class using the default constructor.

Returns:
The new dynamically created object.

load

public java.lang.Object load(java.lang.Class[] classes,
                             java.lang.Object[] args)
Load an instance of a class using the current class name and the constructor parameters specified.

Parameters:
classes - A list of classes that one of the constructors takes as parameters. Pass null if the constructor takes none.
args - The list of associated values for the classes specified.


Copyright © 2008 OCLC Online Computer Library Center, Inc.. All Rights Reserved.