org.exolab.castor.util
Class DefaultObjectFactory

java.lang.Object
  extended by 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: 1.3 $ $Date: 2004/04/09 04:51:24 $
Author:
Keith Visco
See Also:
ObjectFactory

Constructor Summary
DefaultObjectFactory()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultObjectFactory

public DefaultObjectFactory()
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 interface ObjectFactory
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 interface ObjectFactory
Parameters:
type - the Class to create an instance of
args - 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 interface ObjectFactory
Parameters:
type - the Class to create an instance of
argTypes - the Class types for each argument, used to find the correct constructor
args - 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


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com