@ComponentProfile(summary="JSON/XML Transformation driver that uses XStream for conversion", tag="json,xml,transformation") public class XStreamTransformationDriver extends java.lang.Object implements TransformationDriver
XStreamMarshaller
and XStreamJsonMarshaller
.
Because XStream is primarily a way of serializing objects to XML and back again (we are using the
optional JSON support via org.codehaus.jettison:jettison:1.2
), for some types of JSON
data, you will need to create java objects with appropriate XStreamAlias
annotations that
represents your object tree. It is provided for completeness and not expected to be heavily used.
In the adapter configuration file this class is aliased as xstream-json-transformation-driver which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
XStreamTransformationDriver() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
transform(java.lang.String input,
TransformationDirection direction)
Perform transformation.
|
public java.lang.String transform(java.lang.String input, TransformationDirection direction) throws ServiceException
TransformationDriver
transform
in interface TransformationDriver
input
- The data to transform.direction
- The direction of the transformation.ServiceException
- Thrown if there is a problem with the transformation.