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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
init
(org.apache.camel.CamelContext camelContext) Initializes the adapterAttempt to read/convert the message body into aMap
typewriteAsString
(Object value, org.apache.camel.Exchange exchange) Attempts to write the value as a JSOnString
value.
-
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 interfaceJsonPathAdapter
- Parameters:
camelContext
- the CamelContext
-
readValue
Description copied from interface:JsonPathAdapter
Attempt to read/convert the message body into aMap
type- Specified by:
readValue
in interfaceJsonPathAdapter
- Parameters:
body
- the message bodyexchange
- the Camel exchange- Returns:
- converted as
Map
or null if not possible
-
writeAsString
Description copied from interface:JsonPathAdapter
Attempts to write the value as a JSOnString
value.- Specified by:
writeAsString
in interfaceJsonPathAdapter
- Parameters:
value
- the valueexchange
- the Camel exchange- Returns:
- written as
String
JSON or null if not possible
-