Package org.teiid.core.types
Class Transform
- java.lang.Object
-
- org.teiid.core.types.Transform
-
- Direct Known Subclasses:
AnyToObjectTransform
,AnyToStringTransform
,BigDecimalToBigIntegerTransform
,BigIntegerToBigDecimalTransform
,BinaryToBlobTransform
,BlobToBinaryTransform
,BooleanToNumberTransform
,DateToTimestampTransform
,FixedNumberToBigDecimalTransform
,FixedNumberToBigIntegerTransform
,FloatingNumberToBigDecimalTransform
,FloatingNumberToBigIntegerTransform
,GeographyToGeometryTransform
,JsonToClobTransform
,NullToAnyTransform
,NumberToBooleanTransform
,NumberToNumberTransform
,ObjectToAnyTransform
,StringToBigDecimalTransform
,StringToBigIntegerTransform
,StringToBooleanTransform
,StringToByteTransform
,StringToCharacterTransform
,StringToClobTransform
,StringToDateTransform
,StringToDoubleTransform
,StringToFloatTransform
,StringToIntegerTransform
,StringToJsonTransform
,StringToLongTransform
,StringToShortTransform
,StringToSQLXMLTransform
,StringToTimestampTransform
,StringToTimeTransform
,TimestampToDateTransform
,TimestampToTimeTransform
,TimeToTimestampTransform
public abstract class Transform extends Object
This interface represents the transformation from one data type to another. For instance, from java.lang.String to java.lang.Integer where java.lang.String is the the source type, "java.lang.String" is the source name, etc.
-
-
Constructor Summary
Constructors Constructor Description Transform()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getDescription()
Get description.String
getDisplayName()
Get nice display name for GUIs.abstract Class<?>
getSourceType()
Type of the incoming value.String
getSourceTypeName()
Name of the source type.abstract Class<?>
getTargetType()
Type of the outgoing value.String
getTargetTypeName()
Name of the target type.boolean
isExplicit()
String
toString()
Override Object.toString() to do getDisplayName() version.Object
transform(Object value, Class<?> targetType)
This method transforms a value of the source type into a value of the target type.protected abstract Object
transformDirect(Object value)
-
-
-
Method Detail
-
transform
public Object transform(Object value, Class<?> targetType) throws TransformationException
This method transforms a value of the source type into a value of the target type.- Parameters:
value
- Incoming value of source type- Returns:
- Outgoing value of target type
- Throws:
TransformationException
- if value is an incorrect input type or the transformation fails
-
transformDirect
protected abstract Object transformDirect(Object value) throws TransformationException
- Throws:
TransformationException
-
getSourceType
public abstract Class<?> getSourceType()
Type of the incoming value.- Returns:
- Source type
-
getSourceTypeName
public String getSourceTypeName()
Name of the source type.- Returns:
- Name of source type
-
getTargetType
public abstract Class<?> getTargetType()
Type of the outgoing value.- Returns:
- Target type
-
getTargetTypeName
public String getTargetTypeName()
Name of the target type.- Returns:
- Name of target type
-
getDisplayName
public String getDisplayName()
Get nice display name for GUIs.- Returns:
- Display name
-
getDescription
public String getDescription()
Get description.- Returns:
- Description of transform
-
isExplicit
public boolean isExplicit()
-
-