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.
Modifier and Type | Class and Description |
---|---|
static interface |
JsonInboundMessageMapper.JsonMessageParser<P> |
DEFAULT_HEADER_TYPES, headerTypes, MESSAGE_FORMAT_ERROR, payloadType
Constructor and Description |
---|
JsonInboundMessageMapper(Class<?> payloadType,
JsonInboundMessageMapper.JsonMessageParser<?> messageParser) |
JsonInboundMessageMapper(Type payloadType,
JsonInboundMessageMapper.JsonMessageParser<?> messageParser) |
Modifier and Type | Method and 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 the
Message
and supply with headers if necessary and provided. |
isMapToPayload, setHeaderTypes, setMapToPayload
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toMessage
public JsonInboundMessageMapper(Class<?> payloadType, JsonInboundMessageMapper.JsonMessageParser<?> messageParser)
public JsonInboundMessageMapper(Type payloadType, JsonInboundMessageMapper.JsonMessageParser<?> messageParser)
public Type getPayloadType()
public Message<?> toMessage(String jsonMessage, @Nullable Map<String,Object> headers)
InboundMessageMapper
Message
and supply with headers if necessary and provided.jsonMessage
- the object for message payload or some other conversion logicheaders
- additional headers for building message. Can be nullprotected Map<String,Object> readHeaders(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage)
readHeaders
in class AbstractJsonInboundMessageMapper<JsonInboundMessageMapper.JsonMessageParser<?>>
protected Object readPayload(JsonInboundMessageMapper.JsonMessageParser<?> parser, String jsonMessage)
readPayload
in class AbstractJsonInboundMessageMapper<JsonInboundMessageMapper.JsonMessageParser<?>>