Spring Integration

org.springframework.integration.json
Class JsonInboundMessageMapper

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

public class JsonInboundMessageMapper
extends java.lang.Object
implements InboundMessageMapper<java.lang.String>

InboundMessageMapper implementation that maps incoming JSON messages to a Message with the specified payload type.

Since:
2.0
Author:
Jeremy Grelle, Oleg Zhurakousky, Mark Fisher

Constructor Summary
JsonInboundMessageMapper(java.lang.Class<?> payloadType)
           
JsonInboundMessageMapper(org.codehaus.jackson.type.TypeReference<?> typeReference)
           
 
Method Summary
protected  java.util.Map<java.lang.String,java.lang.Object> readHeaders(org.codehaus.jackson.JsonParser parser, java.lang.String jsonMessage)
           
protected  java.lang.Object readPayload(org.codehaus.jackson.JsonParser parser, java.lang.String jsonMessage)
           
 void setHeaderTypes(java.util.Map<java.lang.String,java.lang.Class<?>> headerTypes)
           
 void setMapToPayload(boolean mapToPayload)
           
 void setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper)
           
 Message<?> toMessage(java.lang.String jsonMessage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonInboundMessageMapper

public JsonInboundMessageMapper(java.lang.Class<?> payloadType)

JsonInboundMessageMapper

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

setObjectMapper

public void setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper)

setHeaderTypes

public void setHeaderTypes(java.util.Map<java.lang.String,java.lang.Class<?>> headerTypes)

setMapToPayload

public void setMapToPayload(boolean mapToPayload)

toMessage

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

readHeaders

protected java.util.Map<java.lang.String,java.lang.Object> readHeaders(org.codehaus.jackson.JsonParser parser,
                                                                       java.lang.String jsonMessage)
                                                                throws java.lang.Exception
Throws:
java.lang.Exception

readPayload

protected java.lang.Object readPayload(org.codehaus.jackson.JsonParser parser,
                                       java.lang.String jsonMessage)
                                throws java.lang.Exception
Throws:
java.lang.Exception

Spring Integration