Package com.adaptris.core.transform.json
Class XStreamTransformationDriver
- java.lang.Object
-
- com.adaptris.core.transform.json.XStreamTransformationDriver
-
- All Implemented Interfaces:
TransformationDriver
@ComponentProfile(summary="JSON/XML Transformation driver that uses XStream for conversion", tag="json,xml,transformation") public class XStreamTransformationDriver extends java.lang.Object implements TransformationDriver
Transformation drive that attempts to transform to and from JSON using a combination ofXStreamMarshaller
andXStreamJsonMarshaller
.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 appropriateXStreamAlias
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 Summary
Constructors Constructor Description XStreamTransformationDriver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
transform(java.lang.String input, TransformationDirection direction)
Perform transformation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.transform.json.TransformationDriver
transform
-
-
-
-
Method Detail
-
transform
public java.lang.String transform(java.lang.String input, TransformationDirection direction) throws ServiceException
Description copied from interface:TransformationDriver
Perform transformation.- Specified by:
transform
in interfaceTransformationDriver
- Parameters:
input
- The data to transform.direction
- The direction of the transformation.- Returns:
- The transformed data.
- Throws:
ServiceException
- Thrown if there is a problem with the transformation.
-
-