org.apache.tuscany.sca.databinding.saxon
Class NodeInfo2DataObjectTransformer
java.lang.Object
org.apache.tuscany.sca.databinding.impl.BaseTransformer<NodeInfo,DataObject>
org.apache.tuscany.sca.databinding.saxon.NodeInfo2DataObjectTransformer
- All Implemented Interfaces:
- PullTransformer<NodeInfo,DataObject>, Transformer
public class NodeInfo2DataObjectTransformer
- extends BaseTransformer<NodeInfo,DataObject>
- implements PullTransformer<NodeInfo,DataObject>
Transforms NodeInfo objects to SDO DataObjects.
Before constructing the data object, resulting XML is populated
with correct namespaces (which are taken from the logical target data type)
These namespaces are crucial for constructing the right instance of
the DataObject (i.e. if there is a SDO factory, an instance from this factory will
be used, not the generic any data object)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NodeInfo2DataObjectTransformer
public NodeInfo2DataObjectTransformer(NodeInfo2NodeTransformer nodeInfo2NodeTransformer)
NodeInfo2DataObjectTransformer
public NodeInfo2DataObjectTransformer()
getSourceType
protected java.lang.Class<NodeInfo> getSourceType()
- Specified by:
getSourceType
in class BaseTransformer<NodeInfo,DataObject>
getTargetType
protected java.lang.Class<DataObject> getTargetType()
- Specified by:
getTargetType
in class BaseTransformer<NodeInfo,DataObject>
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<NodeInfo,DataObject>
- Returns:
- An integer representing the cost of the transformation
transform
public DataObject transform(NodeInfo source,
TransformationContext context)
- Description copied from interface:
PullTransformer
- Transform source data into the result type.
- Specified by:
transform
in interface PullTransformer<NodeInfo,DataObject>
- Parameters:
source
- The source datacontext
- The context for the transformation
- Returns:
- The transformed result