org.apache.tuscany.sca.databinding.jaxb
Class JAXB2String

java.lang.Object
  extended by org.apache.tuscany.sca.databinding.impl.BaseTransformer<java.lang.Object,java.lang.String>
      extended by org.apache.tuscany.sca.databinding.jaxb.JAXB2String
All Implemented Interfaces:
PullTransformer<java.lang.Object,java.lang.String>, Transformer

public class JAXB2String
extends BaseTransformer<java.lang.Object,java.lang.String>
implements PullTransformer<java.lang.Object,java.lang.String>


Constructor Summary
JAXB2String()
           
 
Method Summary
 java.lang.String getSourceDataBinding()
          Get the source type that this transformer transforms data from.
protected  java.lang.Class<java.lang.Object> getSourceType()
           
 java.lang.String getTargetDataBinding()
          Get the target type that this transformer transforms data into.
protected  java.lang.Class<java.lang.String> getTargetType()
           
 int getWeight()
          Get the cost of the transformation.
 java.lang.String transform(java.lang.Object source, TransformationContext tContext)
          Transform source data into the result type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXB2String

public JAXB2String()
Method Detail

transform

public java.lang.String transform(java.lang.Object source,
                                  TransformationContext tContext)
Description copied from interface: PullTransformer
Transform source data into the result type.

Specified by:
transform in interface PullTransformer<java.lang.Object,java.lang.String>
Parameters:
source - The source data
tContext - The context for the transformation
Returns:
The transformed result

getSourceType

protected java.lang.Class<java.lang.Object> getSourceType()
Specified by:
getSourceType in class BaseTransformer<java.lang.Object,java.lang.String>

getTargetType

protected java.lang.Class<java.lang.String> getTargetType()
Specified by:
getTargetType in class BaseTransformer<java.lang.Object,java.lang.String>

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
Overrides:
getWeight in class BaseTransformer<java.lang.Object,java.lang.String>
Returns:
An integer representing the cost of the transformation

getSourceDataBinding

public java.lang.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
Overrides:
getSourceDataBinding in class BaseTransformer<java.lang.Object,java.lang.String>
Returns:
A key identifying the source type

getTargetDataBinding

public java.lang.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
Overrides:
getTargetDataBinding in class BaseTransformer<java.lang.Object,java.lang.String>
Returns:
A key identifying the target type