Class JacksonJsonAdapter
java.lang.Object
org.apache.camel.jsonpath.jackson.JacksonJsonAdapter
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(org.apache.camel.CamelContext camelContext) Initializes the adapterAttempt to read/convert the message body into aMaptypewriteAsString(Object value, org.apache.camel.Exchange exchange) Attempts to write the value as a JSOnStringvalue.
-
Constructor Details
-
JacksonJsonAdapter
public JacksonJsonAdapter()
-
-
Method Details
-
init
public void init(org.apache.camel.CamelContext camelContext) Description copied from interface:JsonPathAdapterInitializes the adapter- Specified by:
initin interfaceJsonPathAdapter- Parameters:
camelContext- the CamelContext
-
readValue
Description copied from interface:JsonPathAdapterAttempt to read/convert the message body into aMaptype- Specified by:
readValuein interfaceJsonPathAdapter- Parameters:
body- the message bodyexchange- the Camel exchange- Returns:
- converted as
Mapor null if not possible
-
writeAsString
Description copied from interface:JsonPathAdapterAttempts to write the value as a JSOnStringvalue.- Specified by:
writeAsStringin interfaceJsonPathAdapter- Parameters:
value- the valueexchange- the Camel exchange- Returns:
- written as
StringJSON or null if not possible
-