toolbox.object
Interface ToolboxObjectFactory

Package class diagram package ToolboxObjectFactory
All Known Implementing Classes:
JAMonToolboxObjectFactory, SimpleToolboxObjectFactory

public interface ToolboxObjectFactory

Interface that defines a generic interface to obtain object instances.

Using this type of mechanism to obtain object instances makes it possible to decorate any object instance obtained through the factory.


Method Summary
 java.lang.Object newInstance(java.lang.Class clazz)
          Create a new instance of the given class.
 java.lang.Object newInstance(java.lang.String clazz)
          Create a new instance of the given class.
 java.lang.Object newInstance(java.lang.String clazz, java.lang.ClassLoader loader)
          Create a new instance of the given class using the provided ClassLoader.
 

Method Detail

newInstance

java.lang.Object newInstance(java.lang.String clazz)
                             throws java.lang.Exception
Create a new instance of the given class.

Parameters:
clazz - String containing the name of the class.
Returns:
Object containing an instance of given class.
Throws:
java.lang.Exception - if the Object cannot be created.

newInstance

java.lang.Object newInstance(java.lang.Class clazz)
                             throws java.lang.Exception
Create a new instance of the given class.

Parameters:
clazz - Class instance.
Returns:
Object containing an instance of given class.
Throws:
java.lang.Exception - if the Object cannot be created.

newInstance

java.lang.Object newInstance(java.lang.String clazz,
                             java.lang.ClassLoader loader)
                             throws java.lang.Exception
Create a new instance of the given class using the provided ClassLoader.

Parameters:
clazz - String containing the name of the class.
loader - ClassLoader to use when creating the Object instance.
Returns:
Object containing an instance of given class.
Throws:
java.lang.Exception - if the Object cannot be created.