Class Jackson2JsonMessageParser
java.lang.Object
org.springframework.integration.support.json.Jackson2JsonMessageParser
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,JsonInboundMessageMapper.JsonMessageParser<com.fasterxml.jackson.core.JsonParser>
public class Jackson2JsonMessageParser
extends java.lang.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
-
Constructor Summary
Constructors Constructor Description Jackson2JsonMessageParser()Jackson2JsonMessageParser(Jackson2JsonObjectMapper objectMapper) -
Method Summary
Modifier and Type Method Description protected com.fasterxml.jackson.core.JsonParsercreateJsonParser(java.lang.String jsonMessage)org.springframework.messaging.Message<?>doInParser(JsonInboundMessageMapper messageMapperToUse, java.lang.String jsonMessage, java.util.Map<java.lang.String,java.lang.Object> headers)protected MessageBuilderFactorygetMessageBuilderFactory()protected org.springframework.messaging.Message<?>parseWithHeaders(com.fasterxml.jackson.core.JsonParser parser, java.lang.String jsonMessage, java.util.Map<java.lang.String,java.lang.Object> headersToAdd)protected java.lang.ObjectreadHeader(com.fasterxml.jackson.core.JsonParser parser, java.lang.String headerName, java.lang.String jsonMessage)protected java.lang.ObjectreadPayload(com.fasterxml.jackson.core.JsonParser parser, java.lang.String jsonMessage)voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
-
Constructor Details
-
Jackson2JsonMessageParser
public Jackson2JsonMessageParser() -
Jackson2JsonMessageParser
-
-
Method Details
-
createJsonParser
protected com.fasterxml.jackson.core.JsonParser createJsonParser(java.lang.String jsonMessage) -
parseWithHeaders
protected org.springframework.messaging.Message<?> parseWithHeaders(com.fasterxml.jackson.core.JsonParser parser, java.lang.String jsonMessage, @Nullable java.util.Map<java.lang.String,java.lang.Object> headersToAdd) -
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException- Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
getMessageBuilderFactory
-
doInParser
public org.springframework.messaging.Message<?> doInParser(JsonInboundMessageMapper messageMapperToUse, java.lang.String jsonMessage, @Nullable java.util.Map<java.lang.String,java.lang.Object> headers)- Specified by:
doInParserin interfaceJsonInboundMessageMapper.JsonMessageParser<P>
-
readPayload
protected java.lang.Object readPayload(com.fasterxml.jackson.core.JsonParser parser, java.lang.String jsonMessage) -
readHeader
protected java.lang.Object readHeader(com.fasterxml.jackson.core.JsonParser parser, java.lang.String headerName, java.lang.String jsonMessage)
-