Package org.exolab.castor.util
Class DefaultObjectFactory
- java.lang.Object
-
- org.exolab.castor.util.DefaultObjectFactory
-
- All Implemented Interfaces:
ObjectFactory
public class DefaultObjectFactory extends java.lang.Object implements 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:
ObjectFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultObjectFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
createInstance(java.lang.Class type)
Creates a default instance of the given class.java.lang.Object
createInstance(java.lang.Class type, java.lang.Class[] argTypes, java.lang.Object[] args)
Creates a default instance of the given class.java.lang.Object
createInstance(java.lang.Class type, java.lang.Object[] args)
Creates a default instance of the given class.
-
-
-
Method Detail
-
createInstance
public java.lang.Object createInstance(java.lang.Class type) throws java.lang.IllegalAccessException, java.lang.InstantiationException
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:
java.lang.IllegalAccessException
java.lang.InstantiationException
-
createInstance
public java.lang.Object createInstance(java.lang.Class type, java.lang.Object[] args) throws java.lang.IllegalAccessException, java.lang.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:
java.lang.IllegalAccessException
java.lang.InstantiationException
-
createInstance
public java.lang.Object createInstance(java.lang.Class type, java.lang.Class[] argTypes, java.lang.Object[] args) throws java.lang.IllegalAccessException, java.lang.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:
java.lang.IllegalAccessException
java.lang.InstantiationException
-
-