http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-etcd-starter/src/main/java/org/apache/camel/component/etcd/springboot/EtcdComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-etcd-starter/src/main/java/org/apache/camel/component/etcd/springboot/EtcdComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-etcd-starter/src/main/java/org/apache/camel/component/etcd/springboot/EtcdComponentAutoConfiguration.java index 26290f1..d55357e 100644 --- a/platforms/spring-boot/components-starter/camel-etcd-starter/src/main/java/org/apache/camel/component/etcd/springboot/EtcdComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-etcd-starter/src/main/java/org/apache/camel/component/etcd/springboot/EtcdComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.etcd.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.etcd.EtcdComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(EtcdComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(EtcdComponentConfiguration.class) public class EtcdComponentAutoConfiguration { @Lazy @Bean(name = "etcd-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(EtcdComponent.class) - public EtcdComponent configureEtcdComponent(CamelContext camelContext, - EtcdComponentConfiguration configuration) throws Exception { + public EtcdComponent configureEtcdComponent(CamelContext camelContext) + throws Exception { EtcdComponent component = new EtcdComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; }
http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentAutoConfiguration.java index 9d97d4c..0b3c115 100644 --- a/platforms/spring-boot/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.exec.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.exec.ExecComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(ExecComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(ExecComponentConfiguration.class) public class ExecComponentAutoConfiguration { @Lazy @Bean(name = "exec-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(ExecComponent.class) - public ExecComponent configureExecComponent(CamelContext camelContext, - ExecComponentConfiguration configuration) throws Exception { + public ExecComponent configureExecComponent(CamelContext camelContext) + throws Exception { ExecComponent component = new ExecComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/component/flatpack/springboot/FlatpackComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/component/flatpack/springboot/FlatpackComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/component/flatpack/springboot/FlatpackComponentAutoConfiguration.java index 83534ba..2a9c2f1 100644 --- a/platforms/spring-boot/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/component/flatpack/springboot/FlatpackComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/component/flatpack/springboot/FlatpackComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.flatpack.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.flatpack.FlatpackComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,7 +40,6 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(FlatpackComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(FlatpackComponentConfiguration.class) public class FlatpackComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class FlatpackComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(FlatpackComponent.class) public FlatpackComponent configureFlatpackComponent( - CamelContext camelContext, - FlatpackComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { FlatpackComponent component = new FlatpackComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-fop-starter/src/main/java/org/apache/camel/component/fop/springboot/FopComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-fop-starter/src/main/java/org/apache/camel/component/fop/springboot/FopComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-fop-starter/src/main/java/org/apache/camel/component/fop/springboot/FopComponentAutoConfiguration.java index 98843e4..b5afd94 100644 --- a/platforms/spring-boot/components-starter/camel-fop-starter/src/main/java/org/apache/camel/component/fop/springboot/FopComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-fop-starter/src/main/java/org/apache/camel/component/fop/springboot/FopComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.fop.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.fop.FopComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(FopComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(FopComponentConfiguration.class) public class FopComponentAutoConfiguration { @Lazy @Bean(name = "fop-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(FopComponent.class) - public FopComponent configureFopComponent(CamelContext camelContext, - FopComponentConfiguration configuration) throws Exception { + public FopComponent configureFopComponent(CamelContext camelContext) + throws Exception { FopComponent component = new FopComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpComponentAutoConfiguration.java index 41a3f0a..80427e3 100644 --- a/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.file.remote.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.file.remote.FtpComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(FtpComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(FtpComponentConfiguration.class) public class FtpComponentAutoConfiguration { @Lazy @Bean(name = "ftp-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(FtpComponent.class) - public FtpComponent configureFtpComponent(CamelContext camelContext, - FtpComponentConfiguration configuration) throws Exception { + public FtpComponent configureFtpComponent(CamelContext camelContext) + throws Exception { FtpComponent component = new FtpComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpsComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpsComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpsComponentAutoConfiguration.java index 731b91b..1339272 100644 --- a/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpsComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpsComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.file.remote.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.file.remote.FtpsComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(FtpsComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(FtpsComponentConfiguration.class) public class FtpsComponentAutoConfiguration { @Lazy @Bean(name = "ftps-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(FtpsComponent.class) - public FtpsComponent configureFtpsComponent(CamelContext camelContext, - FtpsComponentConfiguration configuration) throws Exception { + public FtpsComponent configureFtpsComponent(CamelContext camelContext) + throws Exception { FtpsComponent component = new FtpsComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/SftpComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/SftpComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/SftpComponentAutoConfiguration.java index a00d8b3..1c728ea 100644 --- a/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/SftpComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/SftpComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.file.remote.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.file.remote.SftpComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(SftpComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(SftpComponentConfiguration.class) public class SftpComponentAutoConfiguration { @Lazy @Bean(name = "sftp-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SftpComponent.class) - public SftpComponent configureSftpComponent(CamelContext camelContext, - SftpComponentConfiguration configuration) throws Exception { + public SftpComponent configureSftpComponent(CamelContext camelContext) + throws Exception { SftpComponent component = new SftpComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentAutoConfiguration.java index cd6ba02..f3f4725 100644 --- a/platforms/spring-boot/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.geocoder.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.geocoder.GeoCoderComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,7 +40,6 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(GeoCoderComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(GeoCoderComponentConfiguration.class) public class GeoCoderComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class GeoCoderComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(GeoCoderComponent.class) public GeoCoderComponent configureGeoCoderComponent( - CamelContext camelContext, - GeoCoderComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { GeoCoderComponent component = new GeoCoderComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-git-starter/src/main/java/org/apache/camel/component/git/springboot/GitComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-git-starter/src/main/java/org/apache/camel/component/git/springboot/GitComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-git-starter/src/main/java/org/apache/camel/component/git/springboot/GitComponentAutoConfiguration.java index 4a4653b..f63c61e 100644 --- a/platforms/spring-boot/components-starter/camel-git-starter/src/main/java/org/apache/camel/component/git/springboot/GitComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-git-starter/src/main/java/org/apache/camel/component/git/springboot/GitComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.git.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.git.GitComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(GitComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(GitComponentConfiguration.class) public class GitComponentAutoConfiguration { @Lazy @Bean(name = "git-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(GitComponent.class) - public GitComponent configureGitComponent(CamelContext camelContext, - GitComponentConfiguration configuration) throws Exception { + public GitComponent configureGitComponent(CamelContext camelContext) + throws Exception { GitComponent component = new GitComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-github-starter/src/main/java/org/apache/camel/component/github/springboot/GitHubComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-github-starter/src/main/java/org/apache/camel/component/github/springboot/GitHubComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-github-starter/src/main/java/org/apache/camel/component/github/springboot/GitHubComponentAutoConfiguration.java index fe0a7ad..69f7757 100644 --- a/platforms/spring-boot/components-starter/camel-github-starter/src/main/java/org/apache/camel/component/github/springboot/GitHubComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-github-starter/src/main/java/org/apache/camel/component/github/springboot/GitHubComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.github.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.github.GitHubComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(GitHubComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(GitHubComponentConfiguration.class) public class GitHubComponentAutoConfiguration { @Lazy @Bean(name = "github-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(GitHubComponent.class) - public GitHubComponent configureGitHubComponent(CamelContext camelContext, - GitHubComponentConfiguration configuration) throws Exception { + public GitHubComponent configureGitHubComponent(CamelContext camelContext) + throws Exception { GitHubComponent component = new GitHubComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-gora-starter/src/main/java/org/apache/camel/component/gora/springboot/GoraComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-gora-starter/src/main/java/org/apache/camel/component/gora/springboot/GoraComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-gora-starter/src/main/java/org/apache/camel/component/gora/springboot/GoraComponentAutoConfiguration.java index b23dc42..8bc3294 100644 --- a/platforms/spring-boot/components-starter/camel-gora-starter/src/main/java/org/apache/camel/component/gora/springboot/GoraComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-gora-starter/src/main/java/org/apache/camel/component/gora/springboot/GoraComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.gora.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.gora.GoraComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(GoraComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(GoraComponentConfiguration.class) public class GoraComponentAutoConfiguration { @Lazy @Bean(name = "gora-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(GoraComponent.class) - public GoraComponent configureGoraComponent(CamelContext camelContext, - GoraComponentConfiguration configuration) throws Exception { + public GoraComponent configureGoraComponent(CamelContext camelContext) + throws Exception { GoraComponent component = new GoraComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-hipchat-starter/src/main/java/org/apache/camel/component/hipchat/springboot/HipchatComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-hipchat-starter/src/main/java/org/apache/camel/component/hipchat/springboot/HipchatComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-hipchat-starter/src/main/java/org/apache/camel/component/hipchat/springboot/HipchatComponentAutoConfiguration.java index dd2e4a6..7e450a4 100644 --- a/platforms/spring-boot/components-starter/camel-hipchat-starter/src/main/java/org/apache/camel/component/hipchat/springboot/HipchatComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-hipchat-starter/src/main/java/org/apache/camel/component/hipchat/springboot/HipchatComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.hipchat.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.hipchat.HipchatComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,43 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(HipchatComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(HipchatComponentConfiguration.class) public class HipchatComponentAutoConfiguration { @Lazy @Bean(name = "hipchat-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(HipchatComponent.class) - public HipchatComponent configureHipchatComponent( - CamelContext camelContext, - HipchatComponentConfiguration configuration) throws Exception { + public HipchatComponent configureHipchatComponent(CamelContext camelContext) + throws Exception { HipchatComponent component = new HipchatComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/springboot/InfinispanComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/springboot/InfinispanComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/springboot/InfinispanComponentAutoConfiguration.java index 144791c..d306bcf 100644 --- a/platforms/spring-boot/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/springboot/InfinispanComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/springboot/InfinispanComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.infinispan.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.infinispan.InfinispanComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,7 +40,6 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(InfinispanComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(InfinispanComponentConfiguration.class) public class InfinispanComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class InfinispanComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(InfinispanComponent.class) public InfinispanComponent configureInfinispanComponent( - CamelContext camelContext, - InfinispanComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { InfinispanComponent component = new InfinispanComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentAutoConfiguration.java index 7ed233f..f7a0e26 100644 --- a/platforms/spring-boot/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.influxdb.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.influxdb.InfluxDbComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,7 +40,6 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(InfluxDbComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(InfluxDbComponentConfiguration.class) public class InfluxDbComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class InfluxDbComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(InfluxDbComponent.class) public InfluxDbComponent configureInfluxDbComponent( - CamelContext camelContext, - InfluxDbComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { InfluxDbComponent component = new InfluxDbComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-irc-starter/src/main/java/org/apache/camel/component/irc/springboot/IrcComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-irc-starter/src/main/java/org/apache/camel/component/irc/springboot/IrcComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-irc-starter/src/main/java/org/apache/camel/component/irc/springboot/IrcComponentAutoConfiguration.java index 67d9cf8..34a6718 100644 --- a/platforms/spring-boot/components-starter/camel-irc-starter/src/main/java/org/apache/camel/component/irc/springboot/IrcComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-irc-starter/src/main/java/org/apache/camel/component/irc/springboot/IrcComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.irc.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.irc.IrcComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(IrcComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(IrcComponentConfiguration.class) public class IrcComponentAutoConfiguration { @Lazy @Bean(name = "irc-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(IrcComponent.class) - public IrcComponent configureIrcComponent(CamelContext camelContext, - IrcComponentConfiguration configuration) throws Exception { + public IrcComponent configureIrcComponent(CamelContext camelContext) + throws Exception { IrcComponent component = new IrcComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-ironmq-starter/src/main/java/org/apache/camel/component/ironmq/springboot/IronMQComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-ironmq-starter/src/main/java/org/apache/camel/component/ironmq/springboot/IronMQComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-ironmq-starter/src/main/java/org/apache/camel/component/ironmq/springboot/IronMQComponentAutoConfiguration.java index c91ac0a..5053f68 100644 --- a/platforms/spring-boot/components-starter/camel-ironmq-starter/src/main/java/org/apache/camel/component/ironmq/springboot/IronMQComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-ironmq-starter/src/main/java/org/apache/camel/component/ironmq/springboot/IronMQComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.ironmq.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.ironmq.IronMQComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(IronMQComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(IronMQComponentConfiguration.class) public class IronMQComponentAutoConfiguration { @Lazy @Bean(name = "ironmq-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(IronMQComponent.class) - public IronMQComponent configureIronMQComponent(CamelContext camelContext, - IronMQComponentConfiguration configuration) throws Exception { + public IronMQComponent configureIronMQComponent(CamelContext camelContext) + throws Exception { IronMQComponent component = new IronMQComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-javaspace-starter/src/main/java/org/apache/camel/component/javaspace/springboot/JavaSpaceComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-javaspace-starter/src/main/java/org/apache/camel/component/javaspace/springboot/JavaSpaceComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-javaspace-starter/src/main/java/org/apache/camel/component/javaspace/springboot/JavaSpaceComponentAutoConfiguration.java index 32b1ad4..567af38 100644 --- a/platforms/spring-boot/components-starter/camel-javaspace-starter/src/main/java/org/apache/camel/component/javaspace/springboot/JavaSpaceComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-javaspace-starter/src/main/java/org/apache/camel/component/javaspace/springboot/JavaSpaceComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.javaspace.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.javaspace.JavaSpaceComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,7 +40,6 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(JavaSpaceComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(JavaSpaceComponentConfiguration.class) public class JavaSpaceComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class JavaSpaceComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(JavaSpaceComponent.class) public JavaSpaceComponent configureJavaSpaceComponent( - CamelContext camelContext, - JavaSpaceComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { JavaSpaceComponent component = new JavaSpaceComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-jbpm-starter/src/main/java/org/apache/camel/component/jbpm/springboot/JBPMComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-jbpm-starter/src/main/java/org/apache/camel/component/jbpm/springboot/JBPMComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-jbpm-starter/src/main/java/org/apache/camel/component/jbpm/springboot/JBPMComponentAutoConfiguration.java index dc47a8c..e744a5a 100644 --- a/platforms/spring-boot/components-starter/camel-jbpm-starter/src/main/java/org/apache/camel/component/jbpm/springboot/JBPMComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-jbpm-starter/src/main/java/org/apache/camel/component/jbpm/springboot/JBPMComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.jbpm.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.jbpm.JBPMComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(JBPMComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(JBPMComponentConfiguration.class) public class JBPMComponentAutoConfiguration { @Lazy @Bean(name = "jbpm-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(JBPMComponent.class) - public JBPMComponent configureJBPMComponent(CamelContext camelContext, - JBPMComponentConfiguration configuration) throws Exception { + public JBPMComponent configureJBPMComponent(CamelContext camelContext) + throws Exception { JBPMComponent component = new JBPMComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-jcr-starter/src/main/java/org/apache/camel/component/jcr/springboot/JcrComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-jcr-starter/src/main/java/org/apache/camel/component/jcr/springboot/JcrComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-jcr-starter/src/main/java/org/apache/camel/component/jcr/springboot/JcrComponentAutoConfiguration.java index dd9f80a..21ea150 100644 --- a/platforms/spring-boot/components-starter/camel-jcr-starter/src/main/java/org/apache/camel/component/jcr/springboot/JcrComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-jcr-starter/src/main/java/org/apache/camel/component/jcr/springboot/JcrComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.jcr.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.jcr.JcrComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(JcrComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(JcrComponentConfiguration.class) public class JcrComponentAutoConfiguration { @Lazy @Bean(name = "jcr-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(JcrComponent.class) - public JcrComponent configureJcrComponent(CamelContext camelContext, - JcrComponentConfiguration configuration) throws Exception { + public JcrComponent configureJcrComponent(CamelContext camelContext) + throws Exception { JcrComponent component = new JcrComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-jing-starter/src/main/java/org/apache/camel/component/validator/jing/springboot/JingComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-jing-starter/src/main/java/org/apache/camel/component/validator/jing/springboot/JingComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-jing-starter/src/main/java/org/apache/camel/component/validator/jing/springboot/JingComponentAutoConfiguration.java index 8277809..b318b2c 100644 --- a/platforms/spring-boot/components-starter/camel-jing-starter/src/main/java/org/apache/camel/component/validator/jing/springboot/JingComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-jing-starter/src/main/java/org/apache/camel/component/validator/jing/springboot/JingComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.validator.jing.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.validator.jing.JingComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(JingComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(JingComponentConfiguration.class) public class JingComponentAutoConfiguration { @Lazy @Bean(name = "jing-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(JingComponent.class) - public JingComponent configureJingComponent(CamelContext camelContext, - JingComponentConfiguration configuration) throws Exception { + public JingComponent configureJingComponent(CamelContext camelContext) + throws Exception { JingComponent component = new JingComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; }