org.teiid.translator
Class TypeFacility

java.lang.Object
  extended by org.teiid.translator.TypeFacility

public class TypeFacility
extends java.lang.Object


Nested Class Summary
static class TypeFacility.RUNTIME_NAMES
           
static interface TypeFacility.RUNTIME_TYPES
           
 
Constructor Summary
TypeFacility()
           
 
Method Summary
 java.lang.Object convertDate(java.util.Date date, java.util.TimeZone initial, java.util.Calendar target, java.lang.Class<?> targetType)
          Convert the given date to a target type, optionally adjusting its display for a given target Calendar.
 java.lang.Object convertToRuntimeType(java.lang.Object value)
          Convert the given value to the closest runtime type see TypeFacility.RUNTIME_TYPES
static java.lang.Class<?> getDataTypeClass(java.lang.String type)
          Get the Class constant for the given String type name
static java.lang.String getDataTypeName(java.lang.Class<?> type)
          Get the String constant for the given type class
static java.lang.String getDataTypeNameFromSQLType(int sqlType)
           
static int getSQLTypeFromRuntimeType(java.lang.Class<?> type)
          Get the SQL type for the given runtime type Class constant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeFacility

public TypeFacility()
Method Detail

getDataTypeClass

public static java.lang.Class<?> getDataTypeClass(java.lang.String type)
Get the Class constant for the given String type name


getDataTypeName

public static java.lang.String getDataTypeName(java.lang.Class<?> type)
Get the String constant for the given type class


getSQLTypeFromRuntimeType

public static final int getSQLTypeFromRuntimeType(java.lang.Class<?> type)
Get the SQL type for the given runtime type Class constant

Parameters:
type -
Returns:

getDataTypeNameFromSQLType

public static final java.lang.String getDataTypeNameFromSQLType(int sqlType)

convertToRuntimeType

public java.lang.Object convertToRuntimeType(java.lang.Object value)
Convert the given value to the closest runtime type see TypeFacility.RUNTIME_TYPES

Parameters:
value -
Returns:

convertDate

public java.lang.Object convertDate(java.util.Date date,
                                    java.util.TimeZone initial,
                                    java.util.Calendar target,
                                    java.lang.Class<?> targetType)
Convert the given date to a target type, optionally adjusting its display for a given target Calendar.

Parameters:
date -
initial -
target -
targetType -
Returns:


Copyright © 2011. All Rights Reserved.