org.apache.tuscany.spi.databinding.extension
Class TransformerExtension<S,T>
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
registry
protected TransformerRegistry registry
TransformerExtension
protected TransformerExtension()
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
-