use of org.apache.camel.language.xpath.XPathLanguage in project camel by apache.
the class XPathTest method assertResolveLanguage.
@Override
protected Language assertResolveLanguage(String languageName) {
XPathLanguage answer = new XPathLanguage();
answer.setResultType(XPathConstants.STRING);
assertEquals(XPathConstants.STRING, answer.getResultType());
return answer;
}
use of org.apache.camel.language.xpath.XPathLanguage in project camel by apache.
the class XPathLanguageAutoConfiguration method configureXPathLanguage.
@Bean(name = "xpath-language")
@Scope("prototype")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(XPathLanguage.class)
public XPathLanguage configureXPathLanguage(CamelContext camelContext, XPathLanguageConfiguration configuration) throws Exception {
XPathLanguage language = new XPathLanguage();
if (CamelContextAware.class.isAssignableFrom(XPathLanguage.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