org.apache.tuscany.sca.databinding.xml
Class String2SourceTransformer

java.lang.Object
  extended by org.apache.tuscany.sca.databinding.impl.BaseTransformer<java.lang.String,javax.xml.transform.Source>
      extended by org.apache.tuscany.sca.databinding.xml.String2SourceTransformer
All Implemented Interfaces:
PullTransformer<java.lang.String,javax.xml.transform.Source>, Transformer

public class String2SourceTransformer
extends BaseTransformer<java.lang.String,javax.xml.transform.Source>
implements PullTransformer<java.lang.String,javax.xml.transform.Source>

Transform XML String to Source


Constructor Summary
String2SourceTransformer()
           
 
Method Summary
protected  java.lang.Class<java.lang.String> getSourceType()
           
protected  java.lang.Class<javax.xml.transform.Source> getTargetType()
           
 int getWeight()
          Get the cost of the transformation.
 javax.xml.transform.Source transform(java.lang.String source, TransformationContext context)
          Transform source data into the result type.
 
Methods inherited from class org.apache.tuscany.sca.databinding.impl.BaseTransformer
getSourceDataBinding, 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
getSourceDataBinding, getTargetDataBinding
 

Constructor Detail

String2SourceTransformer

public String2SourceTransformer()
Method Detail

transform

public javax.xml.transform.Source transform(java.lang.String source,
                                            TransformationContext context)
Description copied from interface: PullTransformer
Transform source data into the result type.

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

getSourceType

protected java.lang.Class<java.lang.String> getSourceType()
Specified by:
getSourceType in class BaseTransformer<java.lang.String,javax.xml.transform.Source>

getTargetType

protected java.lang.Class<javax.xml.transform.Source> getTargetType()
Specified by:
getTargetType in class BaseTransformer<java.lang.String,javax.xml.transform.Source>

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.String,javax.xml.transform.Source>
Returns:
An integer representing the cost of the transformation