Interface ObjectFactory
- All Known Implementing Classes:
DefaultObjectFactory
public interface ObjectFactory
MyBatis uses an ObjectFactory to create all needed new Objects.
- Author:
- Clinton Begin
-
Method Summary
Modifier and TypeMethodDescription<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.
-
Method Details
-
setProperties
Sets configuration properties.- Parameters:
properties- configuration properties
-
create
Creates a new object with default constructor.- Type Parameters:
T- the generic type- Parameters:
type- Object type- Returns:
- the t
-
create
Creates a new object with the specified constructor and params.- Type Parameters:
T- the generic type- Parameters:
type- Object typeconstructorArgTypes- Constructor argument typesconstructorArgs- Constructor argument values- Returns:
- the t
-
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.- Type Parameters:
T- the generic type- Parameters:
type- Object type- Returns:
- whether it is a collection or not
- Since:
- 3.1.0
-