use of org.apache.camel.jsonpath.JsonPathLanguage in project camel by apache.
the class JsonPathLanguageAutoConfiguration method configureJsonPathLanguage.
@Bean(name = "jsonpath-language")
@Scope("prototype")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(JsonPathLanguage.class)
public JsonPathLanguage configureJsonPathLanguage(CamelContext camelContext, JsonPathLanguageConfiguration configuration) throws Exception {
JsonPathLanguage language = new JsonPathLanguage();
if (CamelContextAware.class.isAssignableFrom(JsonPathLanguage.class)) {
CamelContextAware contextAware = CamelContextAware.class.cast(language);
if (contextAware != null) {
contextAware.setCamelContext(camelContext);
}
}
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null, false);
IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), language, parameters);
return language;
}
Aggregations