Package org.exolab.castor.util
Class DefaultObjectFactory
java.lang.Object
org.exolab.castor.util.DefaultObjectFactory
- All Implemented Interfaces:
ObjectFactory
The default implementation of ObjectFactory used for
creating class instances
- Version:
- $Revision: 6392 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
- Author:
- Keith Visco
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateInstance
(Class type) Creates a default instance of the given class.createInstance
(Class type, Class[] argTypes, Object[] args) Creates a default instance of the given class.createInstance
(Class type, Object[] args) Creates a default instance of the given class.
-
Constructor Details
-
DefaultObjectFactory
public DefaultObjectFactory()
-
-
Method Details
-
createInstance
Creates a default instance of the given class.- Specified by:
createInstance
in interfaceObjectFactory
- Parameters:
type
- the Class to create an instance of- Returns:
- the new instance of the given class
- Throws:
IllegalAccessException
InstantiationException
-
createInstance
public Object createInstance(Class type, Object[] args) throws IllegalAccessException, InstantiationException Creates a default instance of the given class.- Specified by:
createInstance
in interfaceObjectFactory
- Parameters:
type
- the Class to create an instance ofargs
- the array of arguments to pass to the Class constructor- Returns:
- the new instance of the given class
- Throws:
IllegalAccessException
InstantiationException
-
createInstance
public Object createInstance(Class type, Class[] argTypes, Object[] args) throws IllegalAccessException, InstantiationException Creates a default instance of the given class.- Specified by:
createInstance
in interfaceObjectFactory
- Parameters:
type
- the Class to create an instance ofargTypes
- the Class types for each argument, used to find the correct constructorargs
- the array of arguments to pass to the Class constructor- Returns:
- the new instance of the given class
- Throws:
IllegalAccessException
InstantiationException
-