Class Jackson2JsonMessageParser
java.lang.Object
org.springframework.integration.support.json.Jackson2JsonMessageParser
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,JsonInboundMessageMapper.JsonMessageParser<com.fasterxml.jackson.core.JsonParser>
public class Jackson2JsonMessageParser extends Object
JsonInboundMessageMapper.JsonMessageParser
implementation that parses JSON messages
and builds a Message
with the specified payload type from provided JsonInboundMessageMapper
.
Uses Jackson 2 JSON-processor (@link https://github.com/FasterXML).- Since:
- 3.0
- Author:
- Artem Bilan, Gary Russell
-
Constructor Summary
Constructors Constructor Description Jackson2JsonMessageParser()
Jackson2JsonMessageParser(Jackson2JsonObjectMapper objectMapper)
-
Method Summary
Modifier and Type Method Description protected com.fasterxml.jackson.core.JsonParser
createJsonParser(String jsonMessage)
Message<?>
doInParser(JsonInboundMessageMapper messageMapperToUse, String jsonMessage, Map<String,Object> headers)
protected MessageBuilderFactory
getMessageBuilderFactory()
protected Message<?>
parseWithHeaders(com.fasterxml.jackson.core.JsonParser parser, String jsonMessage, Map<String,Object> headersToAdd)
protected Object
readHeader(com.fasterxml.jackson.core.JsonParser parser, String headerName, String jsonMessage)
protected Object
readPayload(com.fasterxml.jackson.core.JsonParser parser, String jsonMessage)
void
setBeanFactory(BeanFactory beanFactory)
-
Constructor Details
-
Jackson2JsonMessageParser
public Jackson2JsonMessageParser() -
Jackson2JsonMessageParser
-
-
Method Details
-
createJsonParser
-
parseWithHeaders
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
getMessageBuilderFactory
-
doInParser
public Message<?> doInParser(JsonInboundMessageMapper messageMapperToUse, String jsonMessage, @Nullable Map<String,Object> headers)- Specified by:
doInParser
in interfaceJsonInboundMessageMapper.JsonMessageParser<P>
-
readPayload
-
readHeader
-