http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java deleted file mode 100644 index e3ebb70..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.impl.springboot; - -import java.util.HashMap; -import java.util.Map; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.impl.StringDataFormat; -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; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -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; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.core.type.AnnotatedTypeMetadata; - -/** - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Configuration -@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@Conditional(StringDataFormatAutoConfiguration.Condition.class) -@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(StringDataFormatConfiguration.class) -public class StringDataFormatAutoConfiguration { - - @Bean(name = "string-dataformat") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) - @ConditionalOnMissingBean(StringDataFormat.class) - public StringDataFormat configureStringDataFormat( - CamelContext camelContext, - StringDataFormatConfiguration configuration) throws Exception { - StringDataFormat dataformat = new StringDataFormat(); - if (CamelContextAware.class.isAssignableFrom(StringDataFormat.class)) { - CamelContextAware contextAware = CamelContextAware.class - .cast(dataformat); - if (contextAware != null) { - contextAware.setCamelContext(camelContext); - } - } - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), dataformat, parameters); - return dataformat; - } - - public static class Condition extends SpringBootCondition { - @Override - public ConditionOutcome getMatchOutcome( - ConditionContext conditionContext, - AnnotatedTypeMetadata annotatedTypeMetadata) { - boolean groupEnabled = isEnabled(conditionContext, - "camel.dataformat.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("camel.dataformat.string"); - if (isEnabled(conditionContext, "camel.dataformat.string.", - groupEnabled)) { - return ConditionOutcome.match(message.because("enabled")); - } - return ConditionOutcome.noMatch(message.because("not enabled")); - } - - private boolean isEnabled( - org.springframework.context.annotation.ConditionContext context, - java.lang.String prefix, boolean defaultValue) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( - context.getEnvironment(), prefix); - return resolver.getProperty("enabled", Boolean.class, defaultValue); - } - } -} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java deleted file mode 100644 index aeccfac..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatConfiguration.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.impl.springboot; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * String (text based) data format - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@ConfigurationProperties(prefix = "camel.dataformat.string") -public class StringDataFormatConfiguration { - - /** - * Sets an encoding to use. Will by default use the JVM platform default - * charset. - */ - private String charset; - /** - * Whether the data format should set the Content-Type header with the type - * from the data format if the data format is capable of doing so. For - * example application/xml for data formats marshalling to XML or - * application/json for data formats marshalling to JSon etc. - */ - private Boolean contentTypeHeader = false; - - public String getCharset() { - return charset; - } - - public void setCharset(String charset) { - this.charset = charset; - } - - public Boolean getContentTypeHeader() { - return contentTypeHeader; - } - - public void setContentTypeHeader(Boolean contentTypeHeader) { - this.contentTypeHeader = contentTypeHeader; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java deleted file mode 100644 index 992c168..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.impl.springboot; - -import java.util.HashMap; -import java.util.Map; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.impl.ZipDataFormat; -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; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -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; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.core.type.AnnotatedTypeMetadata; - -/** - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Configuration -@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@Conditional(ZipDataFormatAutoConfiguration.Condition.class) -@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(ZipDataFormatConfiguration.class) -public class ZipDataFormatAutoConfiguration { - - @Bean(name = "zip-dataformat") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) - @ConditionalOnMissingBean(ZipDataFormat.class) - public ZipDataFormat configureZipDataFormat(CamelContext camelContext, - ZipDataFormatConfiguration configuration) throws Exception { - ZipDataFormat dataformat = new ZipDataFormat(); - if (CamelContextAware.class.isAssignableFrom(ZipDataFormat.class)) { - CamelContextAware contextAware = CamelContextAware.class - .cast(dataformat); - if (contextAware != null) { - contextAware.setCamelContext(camelContext); - } - } - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), dataformat, parameters); - return dataformat; - } - - public static class Condition extends SpringBootCondition { - @Override - public ConditionOutcome getMatchOutcome( - ConditionContext conditionContext, - AnnotatedTypeMetadata annotatedTypeMetadata) { - boolean groupEnabled = isEnabled(conditionContext, - "camel.dataformat.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("camel.dataformat.zip"); - if (isEnabled(conditionContext, "camel.dataformat.zip.", - groupEnabled)) { - return ConditionOutcome.match(message.because("enabled")); - } - return ConditionOutcome.noMatch(message.because("not enabled")); - } - - private boolean isEnabled( - org.springframework.context.annotation.ConditionContext context, - java.lang.String prefix, boolean defaultValue) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( - context.getEnvironment(), prefix); - return resolver.getProperty("enabled", Boolean.class, defaultValue); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java deleted file mode 100644 index 401acb9..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.impl.springboot; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * Zip compression data format (not for zip files) - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@ConfigurationProperties(prefix = "camel.dataformat.zip") -public class ZipDataFormatConfiguration { - - /** - * To specify a specific compression between 0-9. -1 is default compression - * 0 is no compression and 9 is best compression. - */ - private Integer compressionLevel = -1; - /** - * Whether the data format should set the Content-Type header with the type - * from the data format if the data format is capable of doing so. For - * example application/xml for data formats marshalling to XML or - * application/json for data formats marshalling to JSon etc. - */ - private Boolean contentTypeHeader = false; - - public Integer getCompressionLevel() { - return compressionLevel; - } - - public void setCompressionLevel(Integer compressionLevel) { - this.compressionLevel = compressionLevel; - } - - public Boolean getContentTypeHeader() { - return contentTypeHeader; - } - - public void setContentTypeHeader(Boolean contentTypeHeader) { - this.contentTypeHeader = contentTypeHeader; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java deleted file mode 100644 index 6f93fd8..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.bean.springboot; - -import java.util.HashMap; -import java.util.Map; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.language.bean.BeanLanguage; -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; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -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; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.core.type.AnnotatedTypeMetadata; - -/** - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Configuration -@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@Conditional(BeanLanguageAutoConfiguration.Condition.class) -@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(BeanLanguageConfiguration.class) -public class BeanLanguageAutoConfiguration { - - @Bean(name = "bean-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) - @ConditionalOnMissingBean(BeanLanguage.class) - public BeanLanguage configureBeanLanguage(CamelContext camelContext, - BeanLanguageConfiguration configuration) throws Exception { - BeanLanguage language = new BeanLanguage(); - if (CamelContextAware.class.isAssignableFrom(BeanLanguage.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; - } - - public static class Condition extends SpringBootCondition { - @Override - public ConditionOutcome getMatchOutcome( - ConditionContext conditionContext, - AnnotatedTypeMetadata annotatedTypeMetadata) { - boolean groupEnabled = isEnabled(conditionContext, - "camel.language.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("camel.language.bean"); - if (isEnabled(conditionContext, "camel.language.bean.", - groupEnabled)) { - return ConditionOutcome.match(message.because("enabled")); - } - return ConditionOutcome.noMatch(message.because("not enabled")); - } - - private boolean isEnabled( - org.springframework.context.annotation.ConditionContext context, - java.lang.String prefix, boolean defaultValue) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( - context.getEnvironment(), prefix); - return resolver.getProperty("enabled", Boolean.class, defaultValue); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java deleted file mode 100644 index b39a7ac..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.bean.springboot; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * For expressions and predicates using a java bean (aka method call) - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@ConfigurationProperties(prefix = "camel.language.bean") -public class BeanLanguageConfiguration { - - /** - * Whether to trim the value to remove leading and trailing whitespaces and - * line breaks - */ - private Boolean trim = true; - - public Boolean getTrim() { - return trim; - } - - public void setTrim(Boolean trim) { - this.trim = trim; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java deleted file mode 100644 index 50a4b7a..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.constant.springboot; - -import java.util.HashMap; -import java.util.Map; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.language.constant.ConstantLanguage; -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; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -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; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.core.type.AnnotatedTypeMetadata; - -/** - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Configuration -@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@Conditional(ConstantLanguageAutoConfiguration.Condition.class) -@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(ConstantLanguageConfiguration.class) -public class ConstantLanguageAutoConfiguration { - - @Bean(name = "constant-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) - @ConditionalOnMissingBean(ConstantLanguage.class) - public ConstantLanguage configureConstantLanguage( - CamelContext camelContext, - ConstantLanguageConfiguration configuration) throws Exception { - ConstantLanguage language = new ConstantLanguage(); - if (CamelContextAware.class.isAssignableFrom(ConstantLanguage.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; - } - - public static class Condition extends SpringBootCondition { - @Override - public ConditionOutcome getMatchOutcome( - ConditionContext conditionContext, - AnnotatedTypeMetadata annotatedTypeMetadata) { - boolean groupEnabled = isEnabled(conditionContext, - "camel.language.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("camel.language.constant"); - if (isEnabled(conditionContext, "camel.language.constant.", - groupEnabled)) { - return ConditionOutcome.match(message.because("enabled")); - } - return ConditionOutcome.noMatch(message.because("not enabled")); - } - - private boolean isEnabled( - org.springframework.context.annotation.ConditionContext context, - java.lang.String prefix, boolean defaultValue) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( - context.getEnvironment(), prefix); - return resolver.getProperty("enabled", Boolean.class, defaultValue); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java deleted file mode 100644 index cec0509..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.constant.springboot; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * For expressions and predicates using a constant - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@ConfigurationProperties(prefix = "camel.language.constant") -public class ConstantLanguageConfiguration { - - /** - * Whether to trim the value to remove leading and trailing whitespaces and - * line breaks - */ - private Boolean trim = true; - - public Boolean getTrim() { - return trim; - } - - public void setTrim(Boolean trim) { - this.trim = trim; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java deleted file mode 100644 index d49c098..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.header.springboot; - -import java.util.HashMap; -import java.util.Map; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.language.header.HeaderLanguage; -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; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -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; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.core.type.AnnotatedTypeMetadata; - -/** - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Configuration -@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@Conditional(HeaderLanguageAutoConfiguration.Condition.class) -@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(HeaderLanguageConfiguration.class) -public class HeaderLanguageAutoConfiguration { - - @Bean(name = "header-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) - @ConditionalOnMissingBean(HeaderLanguage.class) - public HeaderLanguage configureHeaderLanguage(CamelContext camelContext, - HeaderLanguageConfiguration configuration) throws Exception { - HeaderLanguage language = new HeaderLanguage(); - if (CamelContextAware.class.isAssignableFrom(HeaderLanguage.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; - } - - public static class Condition extends SpringBootCondition { - @Override - public ConditionOutcome getMatchOutcome( - ConditionContext conditionContext, - AnnotatedTypeMetadata annotatedTypeMetadata) { - boolean groupEnabled = isEnabled(conditionContext, - "camel.language.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("camel.language.header"); - if (isEnabled(conditionContext, "camel.language.header.", - groupEnabled)) { - return ConditionOutcome.match(message.because("enabled")); - } - return ConditionOutcome.noMatch(message.because("not enabled")); - } - - private boolean isEnabled( - org.springframework.context.annotation.ConditionContext context, - java.lang.String prefix, boolean defaultValue) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( - context.getEnvironment(), prefix); - return resolver.getProperty("enabled", Boolean.class, defaultValue); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java deleted file mode 100644 index bf00d3a..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.header.springboot; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * An expression which extracts the named exchange header - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@ConfigurationProperties(prefix = "camel.language.header") -public class HeaderLanguageConfiguration { - - /** - * Whether to trim the value to remove leading and trailing whitespaces and - * line breaks - */ - private Boolean trim = true; - - public Boolean getTrim() { - return trim; - } - - public void setTrim(Boolean trim) { - this.trim = trim; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java deleted file mode 100644 index e4456cb..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.property.springboot; - -import java.util.HashMap; -import java.util.Map; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.language.property.ExchangePropertyLanguage; -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; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -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; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.core.type.AnnotatedTypeMetadata; - -/** - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Configuration -@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@Conditional(ExchangePropertyLanguageAutoConfiguration.Condition.class) -@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(ExchangePropertyLanguageConfiguration.class) -public class ExchangePropertyLanguageAutoConfiguration { - - @Bean(name = "exchangeProperty-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) - @ConditionalOnMissingBean(ExchangePropertyLanguage.class) - public ExchangePropertyLanguage configureExchangePropertyLanguage( - CamelContext camelContext, - ExchangePropertyLanguageConfiguration configuration) - throws Exception { - ExchangePropertyLanguage language = new ExchangePropertyLanguage(); - if (CamelContextAware.class - .isAssignableFrom(ExchangePropertyLanguage.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; - } - - public static class Condition extends SpringBootCondition { - @Override - public ConditionOutcome getMatchOutcome( - ConditionContext conditionContext, - AnnotatedTypeMetadata annotatedTypeMetadata) { - boolean groupEnabled = isEnabled(conditionContext, - "camel.language.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("camel.language.exchangeproperty"); - if (isEnabled(conditionContext, "camel.language.exchangeproperty.", - groupEnabled)) { - return ConditionOutcome.match(message.because("enabled")); - } - return ConditionOutcome.noMatch(message.because("not enabled")); - } - - private boolean isEnabled( - org.springframework.context.annotation.ConditionContext context, - java.lang.String prefix, boolean defaultValue) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( - context.getEnvironment(), prefix); - return resolver.getProperty("enabled", Boolean.class, defaultValue); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java deleted file mode 100644 index ef7a21c..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.property.springboot; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * An expression which extracts the named exchange property - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@ConfigurationProperties(prefix = "camel.language.exchangeproperty") -public class ExchangePropertyLanguageConfiguration { - - /** - * Whether to trim the value to remove leading and trailing whitespaces and - * line breaks - */ - private Boolean trim = true; - - public Boolean getTrim() { - return trim; - } - - public void setTrim(Boolean trim) { - this.trim = trim; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java deleted file mode 100644 index 4c64f98..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.ref.springboot; - -import java.util.HashMap; -import java.util.Map; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.language.ref.RefLanguage; -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; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -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; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.core.type.AnnotatedTypeMetadata; - -/** - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Configuration -@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@Conditional(RefLanguageAutoConfiguration.Condition.class) -@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(RefLanguageConfiguration.class) -public class RefLanguageAutoConfiguration { - - @Bean(name = "ref-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) - @ConditionalOnMissingBean(RefLanguage.class) - public RefLanguage configureRefLanguage(CamelContext camelContext, - RefLanguageConfiguration configuration) throws Exception { - RefLanguage language = new RefLanguage(); - if (CamelContextAware.class.isAssignableFrom(RefLanguage.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; - } - - public static class Condition extends SpringBootCondition { - @Override - public ConditionOutcome getMatchOutcome( - ConditionContext conditionContext, - AnnotatedTypeMetadata annotatedTypeMetadata) { - boolean groupEnabled = isEnabled(conditionContext, - "camel.language.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("camel.language.ref"); - if (isEnabled(conditionContext, "camel.language.ref.", groupEnabled)) { - return ConditionOutcome.match(message.because("enabled")); - } - return ConditionOutcome.noMatch(message.because("not enabled")); - } - - private boolean isEnabled( - org.springframework.context.annotation.ConditionContext context, - java.lang.String prefix, boolean defaultValue) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( - context.getEnvironment(), prefix); - return resolver.getProperty("enabled", Boolean.class, defaultValue); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java deleted file mode 100644 index 7893b91..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.ref.springboot; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * For using a custom expression or predicate - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@ConfigurationProperties(prefix = "camel.language.ref") -public class RefLanguageConfiguration { - - /** - * Whether to trim the value to remove leading and trailing whitespaces and - * line breaks - */ - private Boolean trim = true; - - public Boolean getTrim() { - return trim; - } - - public void setTrim(Boolean trim) { - this.trim = trim; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java deleted file mode 100644 index 4891f8a..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.simple.springboot; - -import java.util.HashMap; -import java.util.Map; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.language.simple.FileLanguage; -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; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -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; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.core.type.AnnotatedTypeMetadata; - -/** - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Configuration -@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@Conditional(FileLanguageAutoConfiguration.Condition.class) -@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(FileLanguageConfiguration.class) -public class FileLanguageAutoConfiguration { - - @Bean(name = "file-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) - @ConditionalOnMissingBean(FileLanguage.class) - public FileLanguage configureFileLanguage(CamelContext camelContext, - FileLanguageConfiguration configuration) throws Exception { - FileLanguage language = new FileLanguage(); - if (CamelContextAware.class.isAssignableFrom(FileLanguage.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; - } - - public static class Condition extends SpringBootCondition { - @Override - public ConditionOutcome getMatchOutcome( - ConditionContext conditionContext, - AnnotatedTypeMetadata annotatedTypeMetadata) { - boolean groupEnabled = isEnabled(conditionContext, - "camel.language.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("camel.language.file"); - if (isEnabled(conditionContext, "camel.language.file.", - groupEnabled)) { - return ConditionOutcome.match(message.because("enabled")); - } - return ConditionOutcome.noMatch(message.because("not enabled")); - } - - private boolean isEnabled( - org.springframework.context.annotation.ConditionContext context, - java.lang.String prefix, boolean defaultValue) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( - context.getEnvironment(), prefix); - return resolver.getProperty("enabled", Boolean.class, defaultValue); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java deleted file mode 100644 index f80a9e4..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.simple.springboot; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * For expressions and predicates using the file/simple language - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@ConfigurationProperties(prefix = "camel.language.file") -public class FileLanguageConfiguration { - - /** - * Whether to trim the value to remove leading and trailing whitespaces and - * line breaks - */ - private Boolean trim = true; - - public Boolean getTrim() { - return trim; - } - - public void setTrim(Boolean trim) { - this.trim = trim; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java deleted file mode 100644 index e793c92..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.simple.springboot; - -import java.util.HashMap; -import java.util.Map; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.language.simple.SimpleLanguage; -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; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -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; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.core.type.AnnotatedTypeMetadata; - -/** - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Configuration -@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@Conditional(SimpleLanguageAutoConfiguration.Condition.class) -@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(SimpleLanguageConfiguration.class) -public class SimpleLanguageAutoConfiguration { - - @Bean(name = "simple-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) - @ConditionalOnMissingBean(SimpleLanguage.class) - public SimpleLanguage configureSimpleLanguage(CamelContext camelContext, - SimpleLanguageConfiguration configuration) throws Exception { - SimpleLanguage language = new SimpleLanguage(); - if (CamelContextAware.class.isAssignableFrom(SimpleLanguage.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; - } - - public static class Condition extends SpringBootCondition { - @Override - public ConditionOutcome getMatchOutcome( - ConditionContext conditionContext, - AnnotatedTypeMetadata annotatedTypeMetadata) { - boolean groupEnabled = isEnabled(conditionContext, - "camel.language.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("camel.language.simple"); - if (isEnabled(conditionContext, "camel.language.simple.", - groupEnabled)) { - return ConditionOutcome.match(message.because("enabled")); - } - return ConditionOutcome.noMatch(message.because("not enabled")); - } - - private boolean isEnabled( - org.springframework.context.annotation.ConditionContext context, - java.lang.String prefix, boolean defaultValue) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( - context.getEnvironment(), prefix); - return resolver.getProperty("enabled", Boolean.class, defaultValue); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java deleted file mode 100644 index 4c1e2e9..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.simple.springboot; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * For expressions and predicates using the simple language - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@ConfigurationProperties(prefix = "camel.language.simple") -public class SimpleLanguageConfiguration { - - /** - * Whether to trim the value to remove leading and trailing whitespaces and - * line breaks - */ - private Boolean trim = true; - - public Boolean getTrim() { - return trim; - } - - public void setTrim(Boolean trim) { - this.trim = trim; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java deleted file mode 100644 index 1dbb098..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.tokenizer.springboot; - -import java.util.HashMap; -import java.util.Map; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.language.tokenizer.TokenizeLanguage; -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; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -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; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.core.type.AnnotatedTypeMetadata; - -/** - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Configuration -@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@Conditional(TokenizeLanguageAutoConfiguration.Condition.class) -@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(TokenizeLanguageConfiguration.class) -public class TokenizeLanguageAutoConfiguration { - - @Bean(name = "tokenize-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) - @ConditionalOnMissingBean(TokenizeLanguage.class) - public TokenizeLanguage configureTokenizeLanguage( - CamelContext camelContext, - TokenizeLanguageConfiguration configuration) throws Exception { - TokenizeLanguage language = new TokenizeLanguage(); - if (CamelContextAware.class.isAssignableFrom(TokenizeLanguage.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; - } - - public static class Condition extends SpringBootCondition { - @Override - public ConditionOutcome getMatchOutcome( - ConditionContext conditionContext, - AnnotatedTypeMetadata annotatedTypeMetadata) { - boolean groupEnabled = isEnabled(conditionContext, - "camel.language.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("camel.language.tokenize"); - if (isEnabled(conditionContext, "camel.language.tokenize.", - groupEnabled)) { - return ConditionOutcome.match(message.because("enabled")); - } - return ConditionOutcome.noMatch(message.because("not enabled")); - } - - private boolean isEnabled( - org.springframework.context.annotation.ConditionContext context, - java.lang.String prefix, boolean defaultValue) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( - context.getEnvironment(), prefix); - return resolver.getProperty("enabled", Boolean.class, defaultValue); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java deleted file mode 100644 index 9a30c9b..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.tokenizer.springboot; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * For expressions and predicates using a body or header tokenizer - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@ConfigurationProperties(prefix = "camel.language.tokenize") -public class TokenizeLanguageConfiguration { - - /** - * Whether to trim the value to remove leading and trailing whitespaces and - * line breaks - */ - private Boolean trim = true; - - public Boolean getTrim() { - return trim; - } - - public void setTrim(Boolean trim) { - this.trim = trim; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java deleted file mode 100644 index d346612..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.tokenizer.springboot; - -import java.util.HashMap; -import java.util.Map; -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.language.tokenizer.XMLTokenizeLanguage; -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; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -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; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.core.type.AnnotatedTypeMetadata; - -/** - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@Configuration -@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@Conditional(XMLTokenizeLanguageAutoConfiguration.Condition.class) -@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(XMLTokenizeLanguageConfiguration.class) -public class XMLTokenizeLanguageAutoConfiguration { - - @Bean(name = "xtokenize-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) - @ConditionalOnMissingBean(XMLTokenizeLanguage.class) - public XMLTokenizeLanguage configureXMLTokenizeLanguage( - CamelContext camelContext, - XMLTokenizeLanguageConfiguration configuration) throws Exception { - XMLTokenizeLanguage language = new XMLTokenizeLanguage(); - if (CamelContextAware.class.isAssignableFrom(XMLTokenizeLanguage.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; - } - - public static class Condition extends SpringBootCondition { - @Override - public ConditionOutcome getMatchOutcome( - ConditionContext conditionContext, - AnnotatedTypeMetadata annotatedTypeMetadata) { - boolean groupEnabled = isEnabled(conditionContext, - "camel.language.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("camel.language.xtokenize"); - if (isEnabled(conditionContext, "camel.language.xtokenize.", - groupEnabled)) { - return ConditionOutcome.match(message.because("enabled")); - } - return ConditionOutcome.noMatch(message.because("not enabled")); - } - - private boolean isEnabled( - org.springframework.context.annotation.ConditionContext context, - java.lang.String prefix, boolean defaultValue) { - RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( - context.getEnvironment(), prefix); - return resolver.getProperty("enabled", Boolean.class, defaultValue); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/3b20e362/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java deleted file mode 100644 index 72a32a4..0000000 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.language.tokenizer.springboot; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * For expressions and predicates using a body or header tokenizer - * - * Generated by camel-package-maven-plugin - do not edit this file! - */ -@ConfigurationProperties(prefix = "camel.language.xtokenize") -public class XMLTokenizeLanguageConfiguration { - - /** - * The extraction mode. The available extraction modes are: i - injecting - * the contextual namespace bindings into the extracted token (default) w - - * wrapping the extracted token in its ancestor context u - unwrapping the - * extracted token to its child content t - extracting the text content of - * the specified element - */ - private String mode; - /** - * Whether to trim the value to remove leading and trailing whitespaces and - * line breaks - */ - private Boolean trim = true; - - public String getMode() { - return mode; - } - - public void setMode(String mode) { - this.mode = mode; - } - - public Boolean getTrim() { - return trim; - } - - public void setTrim(Boolean trim) { - this.trim = trim; - } -} \ No newline at end of file