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 interfaceJsonInboundMessageMapper.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()TypegetPayloadType()protected Map<String,Object>readHeaders(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage)protected ObjectreadPayload(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage)Message<?>toMessage(String jsonMessage, Map<String,Object> headers)Convert a provided object to theMessageand supply with headers if necessary and provided.Methods inherited from class org.springframework.integration.support.json.AbstractJsonInboundMessageMapper
isMapToPayload, setHeaderTypes, setMapToPayloadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:InboundMessageMapperConvert a provided object to theMessageand 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:
readHeadersin classAbstractJsonInboundMessageMapper<JsonInboundMessageMapper.JsonMessageParser<?>>
-
readPayload
protected Object readPayload(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage)- Specified by:
readPayloadin classAbstractJsonInboundMessageMapper<JsonInboundMessageMapper.JsonMessageParser<?>>
-