org.springframework.integration.transformer
Class ObjectToMapTransformer
java.lang.Object
org.springframework.integration.transformer.AbstractTransformer
org.springframework.integration.transformer.AbstractPayloadTransformer<Object,Map<?,?>>
org.springframework.integration.transformer.ObjectToMapTransformer
- All Implemented Interfaces:
- Transformer
public class ObjectToMapTransformer
- extends AbstractPayloadTransformer<Object,Map<?,?>>
Will transform an object graph into a flat Map where keys are valid SpEL expressions
and values are of java.lang.* type. This means that this transformer will recursively navigate
through the Object graph until the value could be java.lang.*
It supports Collections, Maps and Arrays which means it will flatten Object's attributes that are defined as such:
private Map> testMapInMapData;
private List departments;
private String[] akaNames;
private Map> mapWithListData;
The resulting Map structure will look similar to this:
person.address.mapWithListData['mapWithListTestData'][1]=blah
departments[0]=HR
person.lname=Case
- Since:
- 2.0
- Author:
- Oleg Zhurakousky
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectToMapTransformer
public ObjectToMapTransformer()
transformPayload
protected Map<String,Object> transformPayload(Object payload)
throws Exception
- Specified by:
transformPayload
in class AbstractPayloadTransformer<Object,Map<?,?>>
- Throws:
Exception
Copyright © 2010. All Rights Reserved.