Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15
OOoRunner test harness

util
Class DynamicClassLoader

java.lang.Object
  |
  +--util.DynamicClassLoader

public class DynamicClassLoader
extends Object


Constructor Summary
DynamicClassLoader()
           
 
Method Summary
static Class forName(String className)
          This method returns a class created by its name created by call to Class.forName().
 Object getInstance(String className)
          Get an instance of a class.
 Object getInstance(String className, Class[] ctorClassTypes, Object[] ctorArgs)
          Get an instance of a class.
 Object getInstance(String className, Object[] ctorArgs)
          Get an instance of a class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicClassLoader

public DynamicClassLoader()
Method Detail

forName

public static Class forName(String className)
                     throws ClassNotFoundException
This method returns a class created by its name created by call to Class.forName().

This method must be overloaded if another loading policy is required for Component and Interface testing classes.

Parameters:
className - The name of the class to create.
Returns:
The created class.

getInstance

public Object getInstance(String className)
                   throws IllegalArgumentException
Get an instance of a class. The empty constructor is used.
Parameters:
className - The class to instantiate.
Returns:
The instance of the class.

getInstance

public Object getInstance(String className,
                          Object[] ctorArgs)
                   throws IllegalArgumentException
Get an instance of a class. The constructor matching to the arguments is used and the arguments are given to this constructor.
Parameters:
className - The class to instantiate.
ctorArgs - Arguments for the constructor.
Returns:
The instance of the class.

getInstance

public Object getInstance(String className,
                          Class[] ctorClassTypes,
                          Object[] ctorArgs)
                   throws IllegalArgumentException
Get an instance of a class. The constructor matching to the given calss types is used and the instance is created using the arguments for the constructor.
Parameters:
className - The class to instantiate.
ctorClassTypes - The class types matching to the constructor.
ctorArgs - Arguments for the constructor.
Returns:
The instance of the class.

OOoRunner test harness

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.