public class ObjectToJsonTransformer extends AbstractTransformer
Modifier and Type | Class and Description |
---|---|
static class |
ObjectToJsonTransformer.ResultType |
Modifier and Type | Field and Description |
---|---|
static String |
JSON_CONTENT_TYPE |
logger
Constructor and Description |
---|
ObjectToJsonTransformer() |
ObjectToJsonTransformer(JsonObjectMapper<?,?> jsonObjectMapper) |
ObjectToJsonTransformer(JsonObjectMapper<?,?> jsonObjectMapper,
ObjectToJsonTransformer.ResultType resultType) |
ObjectToJsonTransformer(ObjectToJsonTransformer.ResultType resultType) |
Modifier and Type | Method and Description |
---|---|
protected Object |
doTransform(Message<?> message)
Subclasses must implement this method to provide the transformation
logic.
|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
void |
setContentType(String contentType)
Sets the content-type header value
|
transform
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, onInit, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toString
public static final String JSON_CONTENT_TYPE
public ObjectToJsonTransformer()
public ObjectToJsonTransformer(JsonObjectMapper<?,?> jsonObjectMapper)
public ObjectToJsonTransformer(ObjectToJsonTransformer.ResultType resultType)
public ObjectToJsonTransformer(JsonObjectMapper<?,?> jsonObjectMapper, ObjectToJsonTransformer.ResultType resultType)
public void setContentType(String contentType)
contentType
- The content type.public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected Object doTransform(Message<?> message) throws Exception
AbstractTransformer
doTransform
in class AbstractTransformer
message
- The message.Exception
- Any exception.