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 ObjectToAnyTransformINSTANCE
-
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 classClassgetSourceType()Type of the incoming value.ClassgetTargetType()Type of the outgoing value.booleanisExplicit()Objecttransform(Object value, Class<?> targetType)This method transforms a value of the source type into a value of the target type.protected ObjecttransformDirect(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:
getSourceTypein classTransform- Returns:
- Source type
-
getTargetType
public Class getTargetType()
Description copied from class:TransformType of the outgoing value.- Specified by:
getTargetTypein classTransform- Returns:
- Target type
-
transform
public Object transform(Object value, Class<?> targetType) throws TransformationException
Description copied from class:TransformThis method transforms a value of the source type into a value of the target type.- Overrides:
transformin 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:
transformDirectin classTransform- Throws:
TransformationException
-
isExplicit
public boolean isExplicit()
- Overrides:
isExplicitin classTransform- See Also:
Transform.isExplicit()
-
-