com.metamatrix.common.types
Class Transform

java.lang.Object
  extended by com.metamatrix.common.types.Transform
Direct Known Subclasses:
AnyToObjectTransform, AnyToStringTransform, BigDecimalToBigIntegerTransform, BigIntegerToBigDecimalTransform, BooleanToNumberTransform, DateToTimestampTransform, FixedNumberToBigDecimalTransform, FixedNumberToBigIntegerTransform, FloatingNumberToBigDecimalTransform, FloatingNumberToBigIntegerTransform, NullToAnyTransform, NumberToBooleanTransform, NumberToByteTransform, NumberToDoubleTransform, NumberToFloatTransform, NumberToIntegerTransform, NumberToLongTransform, NumberToShortTransform, ObjectToAnyTransform, StringToBigDecimalTransform, StringToBigIntegerTransform, StringToBooleanTransform, StringToByteTransform, StringToCharacterTransform, StringToClobTransform, StringToDateTransform, StringToDoubleTransform, StringToFloatTransform, StringToIntegerTransform, StringToLongTransform, StringToShortTransform, StringToSQLXMLTransform, StringToTimestampTransform, StringToTimeTransform, TimestampToDateTransform, TimestampToTimeTransform, TimeToTimestampTransform

public abstract class Transform
extends java.lang.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
Transform()
           
 
Method Summary
protected  void checkValueRange(java.lang.Object value, java.lang.Number min, java.lang.Number max)
           
 boolean equals(java.lang.Object obj)
          Override Object.equals() to build an equals based on src and tgt types.
 java.lang.String getDescription()
          Get description.
 java.lang.String getDisplayName()
          Get nice display name for GUIs.
abstract  java.lang.Class getSourceType()
          Type of the incoming value.
 java.lang.String getSourceTypeName()
          Name of the source type.
abstract  java.lang.Class getTargetType()
          Type of the outgoing value.
 java.lang.String getTargetTypeName()
          Name of the target type.
 int hashCode()
          Override Object.hashCode() to build a hash based on types.
 boolean isExplicit()
           
 java.lang.String toString()
          Override Object.toString() to do getDisplayName() version.
 java.lang.Object transform(java.lang.Object value)
          This method transforms a value of the source type into a value of the target type.
protected abstract  java.lang.Object transformDirect(java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Transform

public Transform()
Method Detail

transform

public java.lang.Object transform(java.lang.Object value)
                           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 java.lang.Object transformDirect(java.lang.Object value)
                                             throws TransformationException
Throws:
TransformationException

getSourceType

public abstract java.lang.Class getSourceType()
Type of the incoming value.

Returns:
Source type

getSourceTypeName

public java.lang.String getSourceTypeName()
Name of the source type.

Returns:
Name of source type

getTargetType

public abstract java.lang.Class getTargetType()
Type of the outgoing value.

Returns:
Target type

getTargetTypeName

public java.lang.String getTargetTypeName()
Name of the target type.

Returns:
Name of target type

getDisplayName

public java.lang.String getDisplayName()
Get nice display name for GUIs.

Returns:
Display name

getDescription

public java.lang.String getDescription()
Get description.

Returns:
Description of transform

isExplicit

public boolean isExplicit()

toString

public java.lang.String toString()
Override Object.toString() to do getDisplayName() version.

Overrides:
toString in class java.lang.Object
Returns:
String representation of object

hashCode

public int hashCode()
Override Object.hashCode() to build a hash based on types.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code

equals

public boolean equals(java.lang.Object obj)
Override Object.equals() to build an equals based on src and tgt types.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Other object
Returns:
True if obj==this

checkValueRange

protected void checkValueRange(java.lang.Object value,
                               java.lang.Number min,
                               java.lang.Number max)
                        throws TransformationException
Throws:
TransformationException


Copyright © 2009. All Rights Reserved.