Class JacksonJsonAdapter

java.lang.Object
org.apache.camel.jsonpath.jackson.JacksonJsonAdapter
All Implemented Interfaces:
JsonPathAdapter

public class JacksonJsonAdapter extends Object implements JsonPathAdapter
A Jackson JsonPathAdapter which is using Jackson to convert the message body to Map. This allows us to support POJO classes with camel-jsonpath.
  • Constructor Details

    • JacksonJsonAdapter

      public JacksonJsonAdapter()
  • Method Details

    • init

      public void init(org.apache.camel.CamelContext camelContext)
      Description copied from interface: JsonPathAdapter
      Initializes the adapter
      Specified by:
      init in interface JsonPathAdapter
      Parameters:
      camelContext - the CamelContext
    • readValue

      public Map readValue(Object body, org.apache.camel.Exchange exchange)
      Description copied from interface: JsonPathAdapter
      Attempt to read/convert the message body into a Map type
      Specified by:
      readValue in interface JsonPathAdapter
      Parameters:
      body - the message body
      exchange - the Camel exchange
      Returns:
      converted as Map or null if not possible
    • writeAsString

      public String writeAsString(Object value, org.apache.camel.Exchange exchange)
      Description copied from interface: JsonPathAdapter
      Attempts to write the value as a JSOn String value.
      Specified by:
      writeAsString in interface JsonPathAdapter
      Parameters:
      value - the value
      exchange - the Camel exchange
      Returns:
      written as String JSON or null if not possible