2016/05/28 - Apache Tuscany has been retired.
For more information, please explore the Attic.
org.apache.tuscany.sca.databinding.json
Class JSON2XMLStreamReader
java.lang.Object
org.apache.tuscany.sca.databinding.impl.BaseTransformer<java.lang.Object,javax.xml.stream.XMLStreamReader>
org.apache.tuscany.sca.databinding.json.JSON2XMLStreamReader
- All Implemented Interfaces:
- PullTransformer<java.lang.Object,javax.xml.stream.XMLStreamReader>, Transformer
public class JSON2XMLStreamReader
- extends BaseTransformer<java.lang.Object,javax.xml.stream.XMLStreamReader>
- implements PullTransformer<java.lang.Object,javax.xml.stream.XMLStreamReader>
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<javax.xml.stream.XMLStreamReader> |
getTargetType()
|
int |
getWeight()
Get the cost of the transformation. |
javax.xml.stream.XMLStreamReader |
transform(java.lang.Object source,
TransformationContext context)
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 |
JSON2XMLStreamReader
public JSON2XMLStreamReader()
getSourceType
protected java.lang.Class<java.lang.Object> getSourceType()
- Specified by:
getSourceType
in class BaseTransformer<java.lang.Object,javax.xml.stream.XMLStreamReader>
getTargetType
protected java.lang.Class<javax.xml.stream.XMLStreamReader> getTargetType()
- Specified by:
getTargetType
in class BaseTransformer<java.lang.Object,javax.xml.stream.XMLStreamReader>
transform
public javax.xml.stream.XMLStreamReader 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,javax.xml.stream.XMLStreamReader>
- Parameters:
source
- The source datacontext
- The context for the transformation
- Returns:
- The transformed result
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,javax.xml.stream.XMLStreamReader>
- 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,javax.xml.stream.XMLStreamReader>
- Returns:
- A key identifying the source type