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.JsonParser createJsonParser​(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 MessageBuilderFactory getMessageBuilderFactory()  
    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.Object readHeader​(com.fasterxml.jackson.core.JsonParser parser, java.lang.String headerName, java.lang.String jsonMessage)  
    protected java.lang.Object readPayload​(com.fasterxml.jackson.core.JsonParser parser, java.lang.String jsonMessage)  
    void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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:
      setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
      Throws:
      org.springframework.beans.BeansException
    • getMessageBuilderFactory

      protected MessageBuilderFactory 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:
      doInParser in interface JsonInboundMessageMapper.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)