org.springframework.integration.transformer
Class ObjectToStringTransformer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.transformer.AbstractTransformer
org.springframework.integration.transformer.AbstractPayloadTransformer<java.lang.Object,java.lang.String>
org.springframework.integration.transformer.ObjectToStringTransformer
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, NamedComponent, Transformer
public class ObjectToStringTransformer
- extends AbstractPayloadTransformer<java.lang.Object,java.lang.String>
A simple transformer that creates an outbound payload by invoking the
inbound payload Object's toString()
method. Unless the
payload is a byte[]
or char[]
. If the payload
is a byte[], it will be transformed to a String containing the
array's contents, using the charset
which, by default, is "UTF-8". If the payload is a char[], it will be
transformed to a String object with the array's contents.
- Since:
- 1.0.1
- Author:
- Mark Fisher, Andrew Cowlin, Gary Russell
Method Summary |
protected java.lang.String |
transformPayload(java.lang.Object payload)
|
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ObjectToStringTransformer
public ObjectToStringTransformer()
ObjectToStringTransformer
public ObjectToStringTransformer(java.lang.String charset)
transformPayload
protected java.lang.String transformPayload(java.lang.Object payload)
throws java.lang.Exception
- Specified by:
transformPayload
in class AbstractPayloadTransformer<java.lang.Object,java.lang.String>
- Throws:
java.lang.Exception