com.ibatis.sqlmap.engine.type
Class TypeHandlerFactory

java.lang.Object
  extended bycom.ibatis.sqlmap.engine.type.TypeHandlerFactory

public class TypeHandlerFactory
extends java.lang.Object

Not much of a suprise, this is a factory class for TypeHandler objects.


Constructor Summary
TypeHandlerFactory()
          Default constructor
 
Method Summary
 TypeHandler getTypeHandler(java.lang.Class type)
          Get a TypeHandler for a class
 TypeHandler getTypeHandler(java.lang.Class type, java.lang.String jdbcType)
          Get a TypeHandler for a class and a JDBC type
 TypeHandler getUnkownTypeHandler()
          When in doubt, get the "unknown" type handler
 boolean hasTypeHandler(java.lang.Class type)
          Tells you if a particular class has a TypeHandler
 void putTypeAlias(java.lang.String alias, java.lang.String value)
          Adds a type alias that is case insensitive.
 void register(java.lang.Class type, java.lang.String jdbcType, TypeHandler handler)
          Register (add) a type handler for a class and JDBC type
 void register(java.lang.Class type, TypeHandler handler)
          Register (add) a type handler for a class
 java.lang.String resolveAlias(java.lang.String string)
          Lookup an aliased class and return it's REAL name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeHandlerFactory

public TypeHandlerFactory()
Default constructor

Method Detail

getTypeHandler

public TypeHandler getTypeHandler(java.lang.Class type)
Get a TypeHandler for a class

Parameters:
type - - the class you want a TypeHandler for
Returns:
- the handler

getTypeHandler

public TypeHandler getTypeHandler(java.lang.Class type,
                                  java.lang.String jdbcType)
Get a TypeHandler for a class and a JDBC type

Parameters:
type - - the class
jdbcType - - the jdbc type
Returns:
- the handler

getUnkownTypeHandler

public TypeHandler getUnkownTypeHandler()
When in doubt, get the "unknown" type handler

Returns:
- if I told you, it would not be unknown, would it?

hasTypeHandler

public boolean hasTypeHandler(java.lang.Class type)
Tells you if a particular class has a TypeHandler

Parameters:
type - - the class
Returns:
- true if there is a TypeHandler

register

public void register(java.lang.Class type,
                     TypeHandler handler)
Register (add) a type handler for a class

Parameters:
type - - the class
handler - - the handler instance

register

public void register(java.lang.Class type,
                     java.lang.String jdbcType,
                     TypeHandler handler)
Register (add) a type handler for a class and JDBC type

Parameters:
type - - the class
jdbcType - - the JDBC type
handler - - the handler instance

resolveAlias

public java.lang.String resolveAlias(java.lang.String string)
Lookup an aliased class and return it's REAL name

Parameters:
string - - the alias
Returns:
- the REAL name

putTypeAlias

public void putTypeAlias(java.lang.String alias,
                         java.lang.String value)
Adds a type alias that is case insensitive. All of the following String, string, StRiNg will equate to the same alias.

Parameters:
alias - - the alias
value - - the real class name