Package org.teiid.translator
Class TypeFacility
- java.lang.Object
-
- org.teiid.translator.TypeFacility
-
public class TypeFacility extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TypeFacility.RUNTIME_CODES
static class
TypeFacility.RUNTIME_NAMES
static interface
TypeFacility.RUNTIME_TYPES
-
Constructor Summary
Constructors Constructor Description TypeFacility()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
convertDate(Date date, TimeZone initial, Calendar target, Class<?> targetType)
Convert the given date to a target type, optionally adjusting its display for a given target Calendar.static Class<?>
convertPrimitiveToObject(Class<?> clazz)
Convert a primitive class to the corresponding object classObject
convertToRuntimeType(Object value)
Convert the given value to the closest runtime type seeTypeFacility.RUNTIME_TYPES
static Class<?>
getDataTypeClass(String type)
Get the Class constant for the given String runtime type name
IMPORTANT: only considered the default runtime typesstatic String
getDataTypeName(Class<?> type)
Get the String constant for the given runtime type classstatic String
getDataTypeNameFromSQLType(int sqlType)
Get the runtime type name for the given SQL typestatic Class<?>
getRuntimeType(Class<?> type)
Get the closest runtime type for the given classstatic int
getSQLTypeFromRuntimeType(Class<?> type)
Get the SQL type for the given runtime type Class constant
-
-
-
Method Detail
-
getDataTypeClass
public static Class<?> getDataTypeClass(String type)
Get the Class constant for the given String runtime type name
IMPORTANT: only considered the default runtime types
-
getDataTypeName
public static String getDataTypeName(Class<?> type)
Get the String constant for the given runtime type class
-
getRuntimeType
public static Class<?> getRuntimeType(Class<?> type)
Get the closest runtime type for the given class
-
getSQLTypeFromRuntimeType
public static final int getSQLTypeFromRuntimeType(Class<?> type)
Get the SQL type for the given runtime type Class constant- Parameters:
type
-- Returns:
-
getDataTypeNameFromSQLType
public static final String getDataTypeNameFromSQLType(int sqlType)
Get the runtime type name for the given SQL type- Parameters:
sqlType
-- Returns:
-
convertToRuntimeType
public Object convertToRuntimeType(Object value)
Convert the given value to the closest runtime type seeTypeFacility.RUNTIME_TYPES
- Parameters:
value
-- Returns:
-
convertDate
public Object convertDate(Date date, TimeZone initial, Calendar target, 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:
-
-