org.apache.tuscany.sca.databinding.saxon
Class Object2ValueTransformer

java.lang.Object
  extended by org.apache.tuscany.sca.databinding.impl.BaseTransformer<java.lang.Object,Value>
      extended by org.apache.tuscany.sca.databinding.saxon.Object2ValueTransformer
All Implemented Interfaces:
PullTransformer<java.lang.Object,Value>, Transformer

public class Object2ValueTransformer
extends BaseTransformer<java.lang.Object,Value>
implements PullTransformer<java.lang.Object,Value>

Transforms generic java objects to Value objects needed by Saxon parser.


Constructor Summary
Object2ValueTransformer()
           
 
Method Summary
 java.lang.String getSourceDataBinding()
          Get the source type that this transformer transforms data from.
protected  java.lang.Class<java.lang.Object> getSourceType()
           
protected  java.lang.Class<Value> getTargetType()
           
 int getWeight()
          Get the cost of the transformation.
 Value transform(java.lang.Object source, TransformationContext context)
          Transform source data into the result type.
 
Methods inherited from class org.apache.tuscany.sca.databinding.impl.BaseTransformer
getTargetDataBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tuscany.sca.databinding.Transformer
getTargetDataBinding
 

Constructor Detail

Object2ValueTransformer

public Object2ValueTransformer()
Method Detail

getSourceType

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

getTargetType

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

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

transform

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

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