Package org.apache.ibatis.type
Class TypeHandlerRegistry
- java.lang.Object
-
- org.apache.ibatis.type.TypeHandlerRegistry
-
public final class TypeHandlerRegistry extends Object
- Author:
- Clinton Begin, Kazuki Shimizu
-
-
Constructor Summary
Constructors Constructor Description TypeHandlerRegistry()
The default constructor.TypeHandlerRegistry(Configuration configuration)
The constructor that pass the MyBatis configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TypeHandler<T>
getInstance(Class<?> javaTypeClass, Class<?> typeHandlerClass)
TypeHandler<?>
getMappingTypeHandler(Class<? extends TypeHandler<?>> handlerType)
<T> TypeHandler<T>
getTypeHandler(Class<T> type)
<T> TypeHandler<T>
getTypeHandler(Class<T> type, JdbcType jdbcType)
TypeHandler<?>
getTypeHandler(JdbcType jdbcType)
<T> TypeHandler<T>
getTypeHandler(TypeReference<T> javaTypeReference)
<T> TypeHandler<T>
getTypeHandler(TypeReference<T> javaTypeReference, JdbcType jdbcType)
Collection<TypeHandler<?>>
getTypeHandlers()
Gets the type handlers.TypeHandler<Object>
getUnknownTypeHandler()
boolean
hasTypeHandler(Class<?> javaType)
boolean
hasTypeHandler(Class<?> javaType, JdbcType jdbcType)
boolean
hasTypeHandler(TypeReference<?> javaTypeReference)
boolean
hasTypeHandler(TypeReference<?> javaTypeReference, JdbcType jdbcType)
void
register(Class<?> typeHandlerClass)
void
register(Class<?> javaTypeClass, Class<?> typeHandlerClass)
void
register(Class<?> javaTypeClass, JdbcType jdbcType, Class<?> typeHandlerClass)
<T> void
register(Class<T> type, JdbcType jdbcType, TypeHandler<? extends T> handler)
<T> void
register(Class<T> javaType, TypeHandler<? extends T> typeHandler)
void
register(String packageName)
void
register(String javaTypeClassName, String typeHandlerClassName)
void
register(JdbcType jdbcType, TypeHandler<?> handler)
<T> void
register(TypeHandler<T> typeHandler)
<T> void
register(TypeReference<T> javaTypeReference, TypeHandler<? extends T> handler)
void
setDefaultEnumTypeHandler(Class<? extends TypeHandler> typeHandler)
Set a defaultTypeHandler
class forEnum
.
-
-
-
Constructor Detail
-
TypeHandlerRegistry
public TypeHandlerRegistry()
The default constructor.
-
TypeHandlerRegistry
public TypeHandlerRegistry(Configuration configuration)
The constructor that pass the MyBatis configuration.- Parameters:
configuration
- a MyBatis configuration- Since:
- 3.5.4
-
-
Method Detail
-
setDefaultEnumTypeHandler
public void setDefaultEnumTypeHandler(Class<? extends TypeHandler> typeHandler)
- Parameters:
typeHandler
- a type handler class forEnum
- Since:
- 3.4.5
-
hasTypeHandler
public boolean hasTypeHandler(Class<?> javaType)
-
hasTypeHandler
public boolean hasTypeHandler(TypeReference<?> javaTypeReference)
-
hasTypeHandler
public boolean hasTypeHandler(TypeReference<?> javaTypeReference, JdbcType jdbcType)
-
getMappingTypeHandler
public TypeHandler<?> getMappingTypeHandler(Class<? extends TypeHandler<?>> handlerType)
-
getTypeHandler
public <T> TypeHandler<T> getTypeHandler(Class<T> type)
-
getTypeHandler
public <T> TypeHandler<T> getTypeHandler(TypeReference<T> javaTypeReference)
-
getTypeHandler
public TypeHandler<?> getTypeHandler(JdbcType jdbcType)
-
getTypeHandler
public <T> TypeHandler<T> getTypeHandler(Class<T> type, JdbcType jdbcType)
-
getTypeHandler
public <T> TypeHandler<T> getTypeHandler(TypeReference<T> javaTypeReference, JdbcType jdbcType)
-
getUnknownTypeHandler
public TypeHandler<Object> getUnknownTypeHandler()
-
register
public void register(JdbcType jdbcType, TypeHandler<?> handler)
-
register
public <T> void register(TypeHandler<T> typeHandler)
-
register
public <T> void register(Class<T> javaType, TypeHandler<? extends T> typeHandler)
-
register
public <T> void register(TypeReference<T> javaTypeReference, TypeHandler<? extends T> handler)
-
register
public <T> void register(Class<T> type, JdbcType jdbcType, TypeHandler<? extends T> handler)
-
register
public void register(Class<?> typeHandlerClass)
-
register
public void register(String javaTypeClassName, String typeHandlerClassName) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
register
public void register(Class<?> javaTypeClass, JdbcType jdbcType, Class<?> typeHandlerClass)
-
getInstance
public <T> TypeHandler<T> getInstance(Class<?> javaTypeClass, Class<?> typeHandlerClass)
-
register
public void register(String packageName)
-
getTypeHandlers
public Collection<TypeHandler<?>> getTypeHandlers()
Gets the type handlers.- Returns:
- the type handlers
- Since:
- 3.2.2
-
-