接口 ObjectFactory
- 所有已知实现类:
DefaultObjectFactory
public interface ObjectFactory
MyBatis uses an ObjectFactory to create all needed new Objects.
- 作者:
- Clinton Begin
-
方法概要
修饰符和类型方法说明<T> TCreates a new object with default constructor.<T> TCreates a new object with the specified constructor and params.<T> booleanisCollection(Class<T> type) Returns true if this object can have a set of other objects.default voidsetProperties(Properties properties) Sets configuration properties.
-
方法详细资料
-
setProperties
Sets configuration properties.- 参数:
properties- configuration properties
-
create
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 typeconstructorArgTypes- Constructor argument typesconstructorArgs- Constructor argument values- 返回:
- the t
- 抛出:
Exception
-
isCollection
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
-