Class 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
    • 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.
      • 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