org.springframework.integration.json
Class ObjectToJsonTransformer

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.transformer.AbstractTransformer
          extended by org.springframework.integration.transformer.AbstractPayloadTransformer<java.lang.Object,java.lang.String>
              extended by org.springframework.integration.json.ObjectToJsonTransformer
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, NamedComponent, Transformer

public class ObjectToJsonTransformer
extends AbstractPayloadTransformer<java.lang.Object,java.lang.String>

Transformer implementation that converts a payload instance into a JSON string representation.

Since:
2.0

Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
ObjectToJsonTransformer()
           
ObjectToJsonTransformer(org.codehaus.jackson.map.ObjectMapper objectMapper)
           
 
Method Summary
protected  java.lang.String transformPayload(java.lang.Object payload)
           
 
Methods inherited from class org.springframework.integration.transformer.AbstractPayloadTransformer
doTransform
 
Methods inherited from class org.springframework.integration.transformer.AbstractTransformer
transform
 
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
 

Constructor Detail

ObjectToJsonTransformer

public ObjectToJsonTransformer(org.codehaus.jackson.map.ObjectMapper objectMapper)

ObjectToJsonTransformer

public ObjectToJsonTransformer()
Method Detail

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