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 EmbeddedHeadersJsonMessageMapper instead.
- Since:
- 2.0
- Author:
- Jeremy Grelle, Oleg Zhurakousky, Mark Fisher, Artem Bilan, Gary Russell
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class AbstractJsonInboundMessageMapper
DEFAULT_HEADER_TYPES, headerTypes, MESSAGE_FORMAT_ERROR, payloadType -
Constructor Summary
ConstructorsConstructorDescriptionJsonInboundMessageMapper(Class<?> payloadType, JsonInboundMessageMapper.JsonMessageParser<?> messageParser) JsonInboundMessageMapper(Type payloadType, JsonInboundMessageMapper.JsonMessageParser<?> messageParser) -
Method Summary
Modifier and TypeMethodDescriptionreadHeaders(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage) protected @Nullable ObjectreadPayload(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage) Message<?> Convert a provided object to theMessageand supply with headers if necessary and provided.Methods inherited from class AbstractJsonInboundMessageMapper
isMapToPayload, setHeaderTypes, setMapToPayloadMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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 @Nullable Map<String,Object> readHeaders(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage) - Specified by:
readHeadersin classAbstractJsonInboundMessageMapper<JsonInboundMessageMapper.JsonMessageParser<?>>
-
readPayload
protected @Nullable Object readPayload(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage) - Specified by:
readPayloadin classAbstractJsonInboundMessageMapper<JsonInboundMessageMapper.JsonMessageParser<?>>
-