Class JsonInboundMessageMapper
java.lang.Object
org.springframework.integration.support.json.AbstractJsonInboundMessageMapper<JsonInboundMessageMapper.JsonMessageParser<?>>
org.springframework.integration.support.json.JsonInboundMessageMapper
- All Implemented Interfaces:
InboundMessageMapper<String>
public class JsonInboundMessageMapper extends AbstractJsonInboundMessageMapper<JsonInboundMessageMapper.JsonMessageParser<?>>
InboundMessageMapper
implementation that maps incoming JSON messages
to a Message
with the specified payload type.
Consider using the EmbeddedJsonHeadersMessageMapper
instead.
- Since:
- 2.0
- Author:
- Jeremy Grelle, Oleg Zhurakousky, Mark Fisher, Artem Bilan, Gary Russell
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
JsonInboundMessageMapper.JsonMessageParser<P>
-
Field Summary
Fields inherited from class org.springframework.integration.support.json.AbstractJsonInboundMessageMapper
DEFAULT_HEADER_TYPES, headerTypes, MESSAGE_FORMAT_ERROR, payloadType
-
Constructor Summary
Constructors Constructor Description JsonInboundMessageMapper(Class<?> payloadType, JsonInboundMessageMapper.JsonMessageParser<?> messageParser)
JsonInboundMessageMapper(Type payloadType, JsonInboundMessageMapper.JsonMessageParser<?> messageParser)
-
Method Summary
Modifier and Type Method Description Map<String,Class<?>>
getHeaderTypes()
Type
getPayloadType()
protected Map<String,Object>
readHeaders(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage)
protected Object
readPayload(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage)
Message<?>
toMessage(String jsonMessage, Map<String,Object> headers)
Convert a provided object to theMessage
and supply with headers if necessary and provided.Methods inherited from class org.springframework.integration.support.json.AbstractJsonInboundMessageMapper
isMapToPayload, setHeaderTypes, setMapToPayload
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.integration.mapping.InboundMessageMapper
toMessage
-
Constructor Details
-
JsonInboundMessageMapper
public JsonInboundMessageMapper(Class<?> payloadType, JsonInboundMessageMapper.JsonMessageParser<?> messageParser) -
JsonInboundMessageMapper
public JsonInboundMessageMapper(Type payloadType, JsonInboundMessageMapper.JsonMessageParser<?> messageParser)
-
-
Method Details
-
getPayloadType
-
getHeaderTypes
-
toMessage
Description copied from interface:InboundMessageMapper
Convert a provided object to theMessage
and supply with headers if necessary and provided.- Parameters:
jsonMessage
- the object for message payload or some other conversion logicheaders
- additional headers for building message. Can be null- Returns:
- the message as a result of mapping
-
readHeaders
protected Map<String,Object> readHeaders(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage)- Specified by:
readHeaders
in classAbstractJsonInboundMessageMapper<JsonInboundMessageMapper.JsonMessageParser<?>>
-
readPayload
protected Object readPayload(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage)- Specified by:
readPayload
in classAbstractJsonInboundMessageMapper<JsonInboundMessageMapper.JsonMessageParser<?>>
-