org.mybatis.generator.internal.types
Class JavaTypeResolverDefaultImpl

java.lang.Object
  extended by org.mybatis.generator.internal.types.JavaTypeResolverDefaultImpl
All Implemented Interfaces:
JavaTypeResolver

public class JavaTypeResolverDefaultImpl
extends Object
implements JavaTypeResolver

Author:
Jeff Butler

Nested Class Summary
static class JavaTypeResolverDefaultImpl.JdbcTypeInformation
           
 
Field Summary
protected  Context context
           
protected  boolean forceBigDecimals
           
protected  Properties properties
           
protected  Map<Integer,JavaTypeResolverDefaultImpl.JdbcTypeInformation> typeMap
           
protected  List<String> warnings
           
 
Constructor Summary
JavaTypeResolverDefaultImpl()
           
 
Method Summary
 void addConfigurationProperties(Properties properties)
          Adds properties for this instance from any properties configured in the JavaTypeResolverConfiguration.
 FullyQualifiedJavaType calculateJavaType(IntrospectedColumn introspectedColumn)
          Calculates and returns the Java type that should be associated with this column based on the jdbc type, length, and scale of the column.
 String calculateJdbcTypeName(IntrospectedColumn introspectedColumn)
          Calculates and returns the JDBC type name that should be associated with this column based on the jdbc type, length, and scale of the column.
 void setContext(Context context)
          Sets the instance of the Context object associated with this instance.
 void setWarnings(List<String> warnings)
          The generator will supply a list to this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

warnings

protected List<String> warnings

properties

protected Properties properties

context

protected Context context

forceBigDecimals

protected boolean forceBigDecimals

typeMap

protected Map<Integer,JavaTypeResolverDefaultImpl.JdbcTypeInformation> typeMap
Constructor Detail

JavaTypeResolverDefaultImpl

public JavaTypeResolverDefaultImpl()
Method Detail

addConfigurationProperties

public void addConfigurationProperties(Properties properties)
Description copied from interface: JavaTypeResolver
Adds properties for this instance from any properties configured in the JavaTypeResolverConfiguration. This method will be called before any of the get methods.

Specified by:
addConfigurationProperties in interface JavaTypeResolver
Parameters:
properties - All properties from the configuration

calculateJavaType

public FullyQualifiedJavaType calculateJavaType(IntrospectedColumn introspectedColumn)
Description copied from interface: JavaTypeResolver
Calculates and returns the Java type that should be associated with this column based on the jdbc type, length, and scale of the column.

Specified by:
calculateJavaType in interface JavaTypeResolver
Parameters:
introspectedColumn - the column whose Java type needs to be calculated
Returns:
the calculated type, or null if an unsupported data type. If null is returned, we will set the type to Object and issue a warning unless the column is ignored or otherwise overridden

calculateJdbcTypeName

public String calculateJdbcTypeName(IntrospectedColumn introspectedColumn)
Description copied from interface: JavaTypeResolver
Calculates and returns the JDBC type name that should be associated with this column based on the jdbc type, length, and scale of the column.

Specified by:
calculateJdbcTypeName in interface JavaTypeResolver
Parameters:
introspectedColumn - the column whose Java type needs to be calculated
Returns:
the calculated type name, or null if an unsupported data type. If null is returned, we will set the type to OTHER and issue a warning unless the column is ignored or otherwise overridden

setWarnings

public void setWarnings(List<String> warnings)
Description copied from interface: JavaTypeResolver
The generator will supply a list to this method. The implementation class may add strings to the list that will be treated as warning messages and displayed to the user. The concept of a warning is that code generation can continue, but that the results may not be what is expected.

Specified by:
setWarnings in interface JavaTypeResolver

setContext

public void setContext(Context context)
Description copied from interface: JavaTypeResolver
Sets the instance of the Context object associated with this instance. This method will be called before any of the get methods.

Specified by:
setContext in interface JavaTypeResolver
Parameters:
context - The current Context


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