Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.databinding
Interface Transformer

All Known Subinterfaces:
DataPipe<S,R>, PullTransformer<S,R>, PushTransformer<S,R>
All Known Implementing Classes:
Java2SimpleTypeTransformer, SimpleType2JavaTransformer, TransformerExtension

public interface Transformer

A transformer provides the data transformation from source type to target type. The cost of the transformation is modeled as weight.


Method Summary
 String getSourceDataBinding()
          Get the source type that this transformer transforms data from.
 String getTargetDataBinding()
          Get the target type that this transformer transforms data into.
 int getWeight()
          Get the cost of the transformation.
 

Method Detail

getSourceDataBinding

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

Returns:
A key indentifying the source type

getTargetDataBinding

String getTargetDataBinding()
Get the target type that this transformer transforms data into. The type is used as the key when the transformer is registered with TransformerRegistry.

Returns:
A key indentifying the target type

getWeight

int getWeight()
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.

Returns:
An integer representing the cost of the transformation

Apache Tuscany SCA Kernel Sub-Project

-