Spring Integration

org.springframework.integration.json
Class InboundJsonMessageMapper

java.lang.Object
  extended by org.springframework.integration.json.InboundJsonMessageMapper
All Implemented Interfaces:
InboundMessageMapper<String>

public class InboundJsonMessageMapper
extends Object
implements InboundMessageMapper<String>

InboundMessageMapper implementation that maps incoming JSON messages to a Message with the specified payload type. TODO - Need to figure out if we need to go as deep in mapping HeaderTypes...right now it wouldn't work if the header type was something like List - cannot assume order as implemented; headers may not always precede the payload

Since:
2.0
Author:
Jeremy Grelle

Constructor Summary
InboundJsonMessageMapper(Class<?> payloadType)
           
InboundJsonMessageMapper(org.codehaus.jackson.type.TypeReference<?> typeReference)
           
 
Method Summary
 void setHeaderTypes(Map<String,Class<?>> headerTypes)
           
 void setMapToPayload(boolean mapToPayload)
           
 Message<?> toMessage(String jsonMessage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InboundJsonMessageMapper

public InboundJsonMessageMapper(Class<?> payloadType)

InboundJsonMessageMapper

public InboundJsonMessageMapper(org.codehaus.jackson.type.TypeReference<?> typeReference)
Method Detail

setHeaderTypes

public void setHeaderTypes(Map<String,Class<?>> headerTypes)

setMapToPayload

public void setMapToPayload(boolean mapToPayload)

toMessage

public Message<?> toMessage(String jsonMessage)
                     throws Exception
Specified by:
toMessage in interface InboundMessageMapper<String>
Throws:
Exception

Spring Integration

Copyright © 2010. All Rights Reserved.