use of org.apache.camel.component.hl7.TerserLanguage in project camel by apache.
the class TerserLanguageAutoConfiguration method configureTerserLanguage.
@Bean(name = "terser-language")
@Scope("prototype")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(TerserLanguage.class)
public TerserLanguage configureTerserLanguage(CamelContext camelContext, TerserLanguageConfiguration configuration) throws Exception {
TerserLanguage language = new TerserLanguage();
if (CamelContextAware.class.isAssignableFrom(TerserLanguage.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