org.apache.ibatis.reflection.factory
Interface ObjectFactory

All Known Implementing Classes:
DefaultObjectFactory

public interface ObjectFactory

MyBatis uses an ObjectFactory to create all needed new Objects.


Method Summary
<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
isCollection(Class<T> type)
          Returns true if this object can have a set of other objects.
 void setProperties(Properties properties)
          Sets configuration properties.
 

Method Detail

setProperties

void setProperties(Properties properties)
Sets configuration properties.

Parameters:
properties - configuration properties

create

<T> T create(Class<T> type)
Creates a new object with default constructor.

Parameters:
type - Object type
Returns:

create

<T> T create(Class<T> type,
             List<Class<?>> constructorArgTypes,
             List<Object> constructorArgs)
Creates a new object with the specified constructor and params.

Parameters:
type - Object type
constructorArgTypes - Constructor argument types
constructorArgs - Constructor argument values
Returns:

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.

Parameters:
type - Object type
Returns:
whether it is a collection or not
Since:
3.1.0


Copyright © 2010-2012 MyBatis.org. All Rights Reserved.