public class JacksonJsonAdapter extends Object implements JsonPathAdapter
JsonPathAdapter
which is using Jackson to convert the message
body to Map
. This allows us to support POJO classes with camel-jsonpath.Constructor and Description |
---|
JacksonJsonAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
init(org.apache.camel.CamelContext camelContext)
Initializes the adapter
|
Map |
readValue(Object body,
org.apache.camel.Exchange exchange)
Attempt to read/convert the message body into a
Map type |
String |
writeAsString(Object value,
org.apache.camel.Exchange exchange)
Attempts to write the value as a JSOn
String value. |
public void init(org.apache.camel.CamelContext camelContext)
JsonPathAdapter
init
in interface JsonPathAdapter
camelContext
- the CamelContextpublic Map readValue(Object body, org.apache.camel.Exchange exchange)
JsonPathAdapter
Map
typereadValue
in interface JsonPathAdapter
body
- the message bodyexchange
- the Camel exchangeMap
or null if not possiblepublic String writeAsString(Object value, org.apache.camel.Exchange exchange)
JsonPathAdapter
String
value.writeAsString
in interface JsonPathAdapter
value
- the valueexchange
- the Camel exchangeString
JSon or null if not possibleApache Camel