Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.databinding.extension
Class TransformerExtension<S,T>

java.lang.Object
  extended by org.apache.tuscany.spi.databinding.extension.TransformerExtension<S,T>
All Implemented Interfaces:
Transformer
Direct Known Subclasses:
Java2SimpleTypeTransformer, SimpleType2JavaTransformer

public abstract class TransformerExtension<S,T>
extends Object
implements Transformer

Base Implementation of Transformer which provides the registration to the transformer registry


Field Summary
protected  TransformerRegistry registry
           
 
Constructor Summary
protected TransformerExtension()
           
 
Method Summary
 String getSourceDataBinding()
          Get the source type that this transformer transforms data from.
protected abstract  Class getSourceType()
           
 String getTargetDataBinding()
          Get the target type that this transformer transforms data into.
protected abstract  Class getTargetType()
           
 int getWeight()
          Get the cost of the transformation.
 void init()
           
 void setTransformerRegistry(TransformerRegistry registry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

registry

protected TransformerRegistry registry
Constructor Detail

TransformerExtension

protected TransformerExtension()
Method Detail

setTransformerRegistry

public void setTransformerRegistry(TransformerRegistry registry)

init

public void init()

getSourceType

protected abstract Class getSourceType()

getTargetType

protected abstract Class getTargetType()

getSourceDataBinding

public String getSourceDataBinding()
Description copied from interface: Transformer
Get the source type that this transformer transforms data from. The type is used as the key when the transformer is registered with TransformerRegistry.

Specified by:
getSourceDataBinding in interface Transformer
Returns:
A key indentifying the source type

getTargetDataBinding

public String getTargetDataBinding()
Description copied from interface: Transformer
Get the target type that this transformer transforms data into. The type is used as the key when the transformer is registered with TransformerRegistry.

Specified by:
getTargetDataBinding in interface Transformer
Returns:
A key indentifying the target type

getWeight

public int getWeight()
Description copied from interface: Transformer
Get the cost of the transformation. The weight can be used to choose the most efficient path if there are more than one available from the source to the target.

Specified by:
getWeight in interface Transformer
Returns:
An integer representing the cost of the transformation

Apache Tuscany SCA Kernel Sub-Project

-