Class DefaultObjectFactory

java.lang.Object
org.apache.ibatis.reflection.factory.DefaultObjectFactory
All Implemented Interfaces:
Serializable, ObjectFactory

public class DefaultObjectFactory extends Object implements ObjectFactory, Serializable
Author:
Clinton Begin
See Also:
  • Constructor Details

    • DefaultObjectFactory

      public DefaultObjectFactory()
  • Method Details

    • create

      public <T> T create(Class<T> type)
      Description copied from interface: ObjectFactory
      Creates a new object with default constructor.
      Specified by:
      create in interface ObjectFactory
      Type Parameters:
      T - the generic type
      Parameters:
      type - Object type
      Returns:
      the t
    • create

      public <T> T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs)
      Description copied from interface: ObjectFactory
      Creates a new object with the specified constructor and params.
      Specified by:
      create in interface ObjectFactory
      Type Parameters:
      T - the generic type
      Parameters:
      type - Object type
      constructorArgTypes - Constructor argument types
      constructorArgs - Constructor argument values
      Returns:
      the t
    • resolveInterface

      protected Class<?> resolveInterface(Class<?> type)
    • isCollection

      public <T> boolean isCollection(Class<T> type)
      Description copied from interface: ObjectFactory
      Returns true if this object can have a set of other objects. It's main purpose is to support non-java.util.Collection objects like Scala collections.
      Specified by:
      isCollection in interface ObjectFactory
      Type Parameters:
      T - the generic type
      Parameters:
      type - Object type
      Returns:
      whether it is a collection or not