接口 ObjectFactory

所有已知实现类:
DefaultObjectFactory

public interface ObjectFactory
MyBatis uses an ObjectFactory to create all needed new Objects.
作者:
Clinton Begin
  • 方法概要

    修饰符和类型
    方法
    说明
    <T> T
    create(Class<T> type)
    Creates a new object with default constructor.
    <T> T
    create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs)
    Creates a new object with the specified constructor and params.
    <T> boolean
    Returns true if this object can have a set of other objects.
    default void
    Sets configuration properties.
  • 方法详细资料

    • setProperties

      default void setProperties(Properties properties)
      Sets configuration properties.
      参数:
      properties - configuration properties
    • create

      <T> T create(Class<T> type) throws Exception
      Creates a new object with default constructor.
      类型参数:
      T - the generic type
      参数:
      type - Object type
      返回:
      the t
      抛出:
      Exception
    • create

      <T> T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs) throws Exception
      Creates a new object with the specified constructor and params.
      类型参数:
      T - the generic type
      参数:
      type - Object type
      constructorArgTypes - Constructor argument types
      constructorArgs - Constructor argument values
      返回:
      the t
      抛出:
      Exception
    • isCollection

      <T> boolean isCollection(Class<T> type)
      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.
      类型参数:
      T - the generic type
      参数:
      type - Object type
      返回:
      whether it is a collection or not
      从以下版本开始:
      3.1.0