Package org.teiid.core.types.basic
Class ObjectToAnyTransform
- java.lang.Object
-
- org.teiid.core.types.Transform
-
- org.teiid.core.types.basic.ObjectToAnyTransform
-
public class ObjectToAnyTransform extends Transform
-
-
Field Summary
Fields Modifier and Type Field Description static ObjectToAnyTransform
INSTANCE
-
Constructor Summary
Constructors Constructor Description ObjectToAnyTransform(Class targetClass)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Class<?>
convertPrimitiveToObject(Class<?> clazz)
Convert a primitive class to the corresponding object classClass
getSourceType()
Type of the incoming value.Class
getTargetType()
Type of the outgoing value.boolean
isExplicit()
Object
transform(Object value, Class<?> targetType)
This method transforms a value of the source type into a value of the target type.protected Object
transformDirect(Object value)
-
Methods inherited from class org.teiid.core.types.Transform
getDescription, getDisplayName, getSourceTypeName, getTargetTypeName, toString
-
-
-
-
Field Detail
-
INSTANCE
public static final ObjectToAnyTransform INSTANCE
-
-
Constructor Detail
-
ObjectToAnyTransform
public ObjectToAnyTransform(Class targetClass)
-
-
Method Detail
-
getSourceType
public Class getSourceType()
Type of the incoming value.- Specified by:
getSourceType
in classTransform
- Returns:
- Source type
-
getTargetType
public Class getTargetType()
Description copied from class:Transform
Type of the outgoing value.- Specified by:
getTargetType
in classTransform
- Returns:
- Target type
-
transform
public Object transform(Object value, Class<?> targetType) throws TransformationException
Description copied from class:Transform
This method transforms a value of the source type into a value of the target type.- Overrides:
transform
in classTransform
- 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 Object transformDirect(Object value) throws TransformationException
- Specified by:
transformDirect
in classTransform
- Throws:
TransformationException
-
isExplicit
public boolean isExplicit()
- Overrides:
isExplicit
in classTransform
- See Also:
Transform.isExplicit()
-
-