public class ObjectToMapTransformer extends AbstractPayloadTransformer<Object,Map<?,?>>
setShouldFlattenKeys(boolean)
method. It supports Collections, Maps and Arrays
which means that for flat maps it will flatten an Object's properties. Below is an example showing how a flattened
Object hierarchy is represented when 'shouldFlattenKeys' is TRUE.
public class Person {
public String name = "John";
public Address address = new Address();
}
public class Address {
private String street = "123 Main Street";
}
The resulting Map would look like this:
{name=John, address.street=123 Main Street}
EXPRESSION_PARSER, logger
Constructor and Description |
---|
ObjectToMapTransformer() |
Modifier and Type | Method and Description |
---|---|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
void |
setShouldFlattenKeys(boolean shouldFlattenKeys) |
protected Map<String,Object> |
transformPayload(Object payload) |
doTransform
transform
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
public void setShouldFlattenKeys(boolean shouldFlattenKeys)
protected Map<String,Object> transformPayload(Object payload) throws Exception
transformPayload
in class AbstractPayloadTransformer<Object,Map<?,?>>
Exception
public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport