Class JacksonJsonAdapter
- java.lang.Object
-
- org.apache.camel.jsonpath.jackson.JacksonJsonAdapter
-
- All Implemented Interfaces:
JsonPathAdapter
public class JacksonJsonAdapter extends Object implements JsonPathAdapter
A JacksonJsonPathAdapterwhich is using Jackson to convert the message body toMap. This allows us to support POJO classes with camel-jsonpath.
-
-
Constructor Summary
Constructors Constructor Description JacksonJsonAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit(org.apache.camel.CamelContext camelContext)Initializes the adapterMapreadValue(Object body, org.apache.camel.Exchange exchange)Attempt to read/convert the message body into aMaptypeStringwriteAsString(Object value, org.apache.camel.Exchange exchange)Attempts to write the value as a JSOnStringvalue.
-
-
-
Method Detail
-
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
public Map readValue(Object body, org.apache.camel.Exchange exchange)
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
public String writeAsString(Object value, org.apache.camel.Exchange exchange)
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
-
-