Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0AAEF200B51 for ; Mon, 1 Aug 2016 10:16:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 091C9160A5D; Mon, 1 Aug 2016 08:16:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 73DC0160A65 for ; Mon, 1 Aug 2016 10:16:20 +0200 (CEST) Received: (qmail 221 invoked by uid 500); 1 Aug 2016 08:16:19 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 179 invoked by uid 99); 1 Aug 2016 08:16:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2016 08:16:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 547ABE108B; Mon, 1 Aug 2016 08:16:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Mon, 01 Aug 2016 08:16:21 -0000 Message-Id: <01d42b1dcc4e49d8893be9282bd49457@git.apache.org> In-Reply-To: <02a773de4bc64d3fbe1020292114cb40@git.apache.org> References: <02a773de4bc64d3fbe1020292114cb40@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/4] camel git commit: CAMEL-10209: spring boot - Auto configuration for languages archived-at: Mon, 01 Aug 2016 08:16:23 -0000 CAMEL-10209: spring boot - Auto configuration for languages Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/53eba311 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/53eba311 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/53eba311 Branch: refs/heads/master Commit: 53eba311b09d3b40b5fdaddce9f1a04f735e0314 Parents: a7dedd6 Author: Claus Ibsen Authored: Mon Aug 1 09:39:54 2016 +0200 Committer: Claus Ibsen Committed: Mon Aug 1 10:16:12 2016 +0200 ---------------------------------------------------------------------- .../BeanLanguageAutoConfiguration.java | 54 +++++++ .../springboot/BeanLanguageConfiguration.java | 95 +++++++++++ .../ConstantLanguageAutoConfiguration.java | 55 +++++++ .../ConstantLanguageConfiguration.java | 42 +++++ .../HeaderLanguageAutoConfiguration.java | 54 +++++++ .../springboot/HeaderLanguageConfiguration.java | 42 +++++ ...changePropertyLanguageAutoConfiguration.java | 56 +++++++ .../ExchangePropertyLanguageConfiguration.java | 42 +++++ .../RefLanguageAutoConfiguration.java | 54 +++++++ .../springboot/RefLanguageConfiguration.java | 42 +++++ .../FileLanguageAutoConfiguration.java | 54 +++++++ .../springboot/FileLanguageConfiguration.java | 42 +++++ .../SimpleLanguageAutoConfiguration.java | 54 +++++++ .../springboot/SimpleLanguageConfiguration.java | 42 +++++ .../TokenizeLanguageAutoConfiguration.java | 55 +++++++ .../TokenizeLanguageConfiguration.java | 157 +++++++++++++++++++ .../XMLTokenizeLanguageAutoConfiguration.java | 55 +++++++ .../XMLTokenizeLanguageConfiguration.java | 82 ++++++++++ .../XPathLanguageAutoConfiguration.java | 54 +++++++ .../springboot/XPathLanguageConfiguration.java | 114 ++++++++++++++ .../main/resources/META-INF/spring.factories | 22 ++- .../GroovyLanguageAutoConfiguration.java | 54 +++++++ .../springboot/GroovyLanguageConfiguration.java | 42 +++++ .../main/resources/META-INF/spring.factories | 19 +++ .../TerserLanguageAutoConfiguration.java | 54 +++++++ .../springboot/TerserLanguageConfiguration.java | 42 +++++ .../main/resources/META-INF/spring.factories | 4 +- .../SqlLanguageAutoConfiguration.java | 54 +++++++ .../springboot/SqlLanguageConfiguration.java | 42 +++++ .../main/resources/META-INF/spring.factories | 19 +++ .../JsonPathLanguageAutoConfiguration.java | 55 +++++++ .../JsonPathLanguageConfiguration.java | 66 ++++++++ .../main/resources/META-INF/spring.factories | 19 +++ .../JuelLanguageAutoConfiguration.java | 54 +++++++ .../springboot/JuelLanguageConfiguration.java | 42 +++++ .../main/resources/META-INF/spring.factories | 19 +++ .../JXPathLanguageAutoConfiguration.java | 54 +++++++ .../springboot/JXPathLanguageConfiguration.java | 56 +++++++ .../main/resources/META-INF/spring.factories | 19 +++ .../MvelLanguageAutoConfiguration.java | 54 +++++++ .../springboot/MvelLanguageConfiguration.java | 42 +++++ .../main/resources/META-INF/spring.factories | 19 +++ .../OgnlLanguageAutoConfiguration.java | 54 +++++++ .../springboot/OgnlLanguageConfiguration.java | 42 +++++ .../main/resources/META-INF/spring.factories | 19 +++ .../XQueryLanguageAutoConfiguration.java | 54 +++++++ .../springboot/XQueryLanguageConfiguration.java | 67 ++++++++ .../main/resources/META-INF/spring.factories | 4 +- .../JavaScriptLanguageAutoConfiguration.java | 55 +++++++ .../JavaScriptLanguageConfiguration.java | 42 +++++ .../PhpLanguageAutoConfiguration.java | 54 +++++++ .../springboot/PhpLanguageConfiguration.java | 42 +++++ .../PythonLanguageAutoConfiguration.java | 54 +++++++ .../springboot/PythonLanguageConfiguration.java | 42 +++++ .../RubyLanguageAutoConfiguration.java | 54 +++++++ .../springboot/RubyLanguageConfiguration.java | 42 +++++ .../main/resources/META-INF/spring.factories | 25 +++ .../SpelLanguageAutoConfiguration.java | 54 +++++++ .../springboot/SpelLanguageConfiguration.java | 42 +++++ .../main/resources/META-INF/spring.factories | 4 +- 60 files changed, 2842 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/camel-core/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java new file mode 100644 index 0000000..d059788 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(BeanLanguageConfiguration.class) +public class BeanLanguageAutoConfiguration { + + @Bean(name = "bean-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(BeanLanguage.class) + public BeanLanguage configureBeanLanguage(CamelContext camelContext, + BeanLanguageConfiguration configuration) throws Exception { + BeanLanguage language = new BeanLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/camel-core/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java new file mode 100644 index 0000000..6fbb0c6 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageConfiguration.java @@ -0,0 +1,95 @@ +/** + * 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; +import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; + +/** + * 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 { + + /** + * Either a reference or a class name of the bean to use + */ + @Deprecated + private String bean; + /** + * Reference to bean to lookup in the registry + */ + private String ref; + /** + * Name of method to call + */ + private String method; + /** + * Class name of the bean to use + */ + private String beanType; + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + @Deprecated + @DeprecatedConfigurationProperty + public String getBean() { + return bean; + } + + @Deprecated + public void setBean(String bean) { + this.bean = bean; + } + + public String getRef() { + return ref; + } + + public void setRef(String ref) { + this.ref = ref; + } + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + public String getBeanType() { + return beanType; + } + + public void setBeanType(String beanType) { + this.beanType = beanType; + } + + 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/53eba311/camel-core/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java new file mode 100644 index 0000000..996c5d2 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java @@ -0,0 +1,55 @@ +/** + * 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.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(ConstantLanguageConfiguration.class) +public class ConstantLanguageAutoConfiguration { + + @Bean(name = "constant-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(ConstantLanguage.class) + public ConstantLanguage configureConstantLanguage( + CamelContext camelContext, + ConstantLanguageConfiguration configuration) throws Exception { + ConstantLanguage language = new ConstantLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/camel-core/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java new file mode 100644 index 0000000..cec0509 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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/53eba311/camel-core/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java new file mode 100644 index 0000000..93276ef --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(HeaderLanguageConfiguration.class) +public class HeaderLanguageAutoConfiguration { + + @Bean(name = "header-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(HeaderLanguage.class) + public HeaderLanguage configureHeaderLanguage(CamelContext camelContext, + HeaderLanguageConfiguration configuration) throws Exception { + HeaderLanguage language = new HeaderLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/camel-core/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java new file mode 100644 index 0000000..bf00d3a --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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/53eba311/camel-core/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java new file mode 100644 index 0000000..824866b --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java @@ -0,0 +1,56 @@ +/** + * 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.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(ExchangePropertyLanguageConfiguration.class) +public class ExchangePropertyLanguageAutoConfiguration { + + @Bean(name = "exchangeProperty-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(ExchangePropertyLanguage.class) + public ExchangePropertyLanguage configureExchangePropertyLanguage( + CamelContext camelContext, + ExchangePropertyLanguageConfiguration configuration) + throws Exception { + ExchangePropertyLanguage language = new ExchangePropertyLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/camel-core/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java new file mode 100644 index 0000000..ef7a21c --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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/53eba311/camel-core/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java new file mode 100644 index 0000000..49f3588 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(RefLanguageConfiguration.class) +public class RefLanguageAutoConfiguration { + + @Bean(name = "ref-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(RefLanguage.class) + public RefLanguage configureRefLanguage(CamelContext camelContext, + RefLanguageConfiguration configuration) throws Exception { + RefLanguage language = new RefLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/camel-core/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java new file mode 100644 index 0000000..29500c5 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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 + * + * 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/53eba311/camel-core/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java new file mode 100644 index 0000000..422ea84 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(FileLanguageConfiguration.class) +public class FileLanguageAutoConfiguration { + + @Bean(name = "file-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(FileLanguage.class) + public FileLanguage configureFileLanguage(CamelContext camelContext, + FileLanguageConfiguration configuration) throws Exception { + FileLanguage language = new FileLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/camel-core/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java new file mode 100644 index 0000000..f80a9e4 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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/53eba311/camel-core/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java new file mode 100644 index 0000000..52811ec --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(SimpleLanguageConfiguration.class) +public class SimpleLanguageAutoConfiguration { + + @Bean(name = "simple-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SimpleLanguage.class) + public SimpleLanguage configureSimpleLanguage(CamelContext camelContext, + SimpleLanguageConfiguration configuration) throws Exception { + SimpleLanguage language = new SimpleLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/camel-core/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java new file mode 100644 index 0000000..4c1e2e9 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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/53eba311/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java new file mode 100644 index 0000000..6a902ac --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java @@ -0,0 +1,55 @@ +/** + * 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.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(TokenizeLanguageConfiguration.class) +public class TokenizeLanguageAutoConfiguration { + + @Bean(name = "tokenize-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(TokenizeLanguage.class) + public TokenizeLanguage configureTokenizeLanguage( + CamelContext camelContext, + TokenizeLanguageConfiguration configuration) throws Exception { + TokenizeLanguage language = new TokenizeLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java new file mode 100644 index 0000000..099015a --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java @@ -0,0 +1,157 @@ +/** + * 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 { + + /** + * The (start) token to use as tokenizer for example \n for a new line + * token. You can use simple language as the token to support dynamic + * tokens. + */ + private String token; + /** + * The end token to use as tokenizer if using start/end token pairs. You can + * use simple language as the token to support dynamic tokens. + */ + private String endToken; + /** + * To inherit namespaces from a root/parent tag name when using XML You can + * use simple language as the tag name to support dynamic names. + */ + private String inheritNamespaceTagName; + /** + * Name of header to tokenize instead of using the message body. + */ + private String headerName; + /** + * If the token is a regular expression pattern. The default value is false + */ + private Boolean regex = false; + /** + * Whether the input is XML messages. This option must be set to true if + * working with XML payloads. + */ + private Boolean xml = false; + /** + * Whether to include the tokens in the parts when using pairs The default + * value is false + */ + private Boolean includeTokens = false; + /** + * To group N parts together for example to split big files into chunks of + * 1000 lines. + */ + private Integer group; + /** + * To skip the very first element + */ + private Boolean skipFirst = false; + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public String getEndToken() { + return endToken; + } + + public void setEndToken(String endToken) { + this.endToken = endToken; + } + + public String getInheritNamespaceTagName() { + return inheritNamespaceTagName; + } + + public void setInheritNamespaceTagName(String inheritNamespaceTagName) { + this.inheritNamespaceTagName = inheritNamespaceTagName; + } + + public String getHeaderName() { + return headerName; + } + + public void setHeaderName(String headerName) { + this.headerName = headerName; + } + + public Boolean getRegex() { + return regex; + } + + public void setRegex(Boolean regex) { + this.regex = regex; + } + + public Boolean getXml() { + return xml; + } + + public void setXml(Boolean xml) { + this.xml = xml; + } + + public Boolean getIncludeTokens() { + return includeTokens; + } + + public void setIncludeTokens(Boolean includeTokens) { + this.includeTokens = includeTokens; + } + + public Integer getGroup() { + return group; + } + + public void setGroup(Integer group) { + this.group = group; + } + + public Boolean getSkipFirst() { + return skipFirst; + } + + public void setSkipFirst(Boolean skipFirst) { + this.skipFirst = skipFirst; + } + + 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/53eba311/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java new file mode 100644 index 0000000..9d8fd7b --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java @@ -0,0 +1,55 @@ +/** + * 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.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(XMLTokenizeLanguageConfiguration.class) +public class XMLTokenizeLanguageAutoConfiguration { + + @Bean(name = "xtokenize-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(XMLTokenizeLanguage.class) + public XMLTokenizeLanguage configureXMLTokenizeLanguage( + CamelContext camelContext, + XMLTokenizeLanguageConfiguration configuration) throws Exception { + XMLTokenizeLanguage language = new XMLTokenizeLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java new file mode 100644 index 0000000..00d591e --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java @@ -0,0 +1,82 @@ +/** + * 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 { + + /** + * Name of header to tokenize instead of using the message body. + */ + private String headerName; + /** + * 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; + /** + * To group N parts together + */ + private Integer group; + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public String getHeaderName() { + return headerName; + } + + public void setHeaderName(String headerName) { + this.headerName = headerName; + } + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + public Integer getGroup() { + return group; + } + + public void setGroup(Integer group) { + this.group = group; + } + + 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/53eba311/camel-core/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java new file mode 100644 index 0000000..2dfd6b8 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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.xpath.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.xpath.XPathLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(XPathLanguageConfiguration.class) +public class XPathLanguageAutoConfiguration { + + @Bean(name = "xpath-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(XPathLanguage.class) + public XPathLanguage configureXPathLanguage(CamelContext camelContext, + XPathLanguageConfiguration configuration) throws Exception { + XPathLanguage language = new XPathLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/camel-core/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageConfiguration.java b/camel-core/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageConfiguration.java new file mode 100644 index 0000000..ea54a32 --- /dev/null +++ b/camel-core/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageConfiguration.java @@ -0,0 +1,114 @@ +/** + * 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.xpath.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For XPath expressions and predicates + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.xpath") +public class XPathLanguageConfiguration { + + /** + * Name of class for document type The default value is org.w3c.dom.Document + */ + private String documentType; + /** + * Whether to use Saxon. + */ + private Boolean saxon = false; + /** + * References to a custom XPathFactory to lookup in the registry + */ + private String factoryRef; + /** + * The XPath object model to use + */ + private String objectModel; + /** + * Whether to log namespaces which can assist during trouble shooting + */ + private Boolean logNamespaces = false; + /** + * Name of header to use as input instead of the message body + */ + private String headerName; + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public String getDocumentType() { + return documentType; + } + + public void setDocumentType(String documentType) { + this.documentType = documentType; + } + + public Boolean getSaxon() { + return saxon; + } + + public void setSaxon(Boolean saxon) { + this.saxon = saxon; + } + + public String getFactoryRef() { + return factoryRef; + } + + public void setFactoryRef(String factoryRef) { + this.factoryRef = factoryRef; + } + + public String getObjectModel() { + return objectModel; + } + + public void setObjectModel(String objectModel) { + this.objectModel = objectModel; + } + + public Boolean getLogNamespaces() { + return logNamespaces; + } + + public void setLogNamespaces(Boolean logNamespaces) { + this.logNamespaces = logNamespaces; + } + + public String getHeaderName() { + return headerName; + } + + public void setHeaderName(String headerName) { + this.headerName = headerName; + } + + 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/53eba311/camel-core/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/camel-core/src/main/resources/META-INF/spring.factories b/camel-core/src/main/resources/META-INF/spring.factories index c610d4b..61bec9e 100644 --- a/camel-core/src/main/resources/META-INF/spring.factories +++ b/camel-core/src/main/resources/META-INF/spring.factories @@ -28,7 +28,27 @@ org.apache.camel.component.xslt.springboot.XsltComponentAutoConfiguration,\ org.apache.camel.impl.springboot.GzipDataFormatAutoConfiguration,\ org.apache.camel.impl.springboot.SerializationDataFormatAutoConfiguration,\ org.apache.camel.impl.springboot.StringDataFormatAutoConfiguration,\ -org.apache.camel.impl.springboot.ZipDataFormatAutoConfiguration +org.apache.camel.impl.springboot.ZipDataFormatAutoConfiguration,\ +org.apache.camel.language.constant.springboot.ConstantLanguageAutoConfiguration,\ +org.apache.camel.language.simple.springboot.SimpleLanguageAutoConfiguration,\ +org.apache.camel.language.ref.springboot.RefLanguageAutoConfiguration,\ +org.apache.camel.language.bean.springboot.BeanLanguageAutoConfiguration,\ +org.apache.camel.language.header.springboot.HeaderLanguageAutoConfiguration,\ +org.apache.camel.language.xpath.springboot.XPathLanguageAutoConfiguration,\ +org.apache.camel.language.simple.springboot.FileLanguageAutoConfiguration,\ +org.apache.camel.language.property.springboot.ExchangePropertyLanguageAutoConfiguration,\ +org.apache.camel.language.tokenizer.springboot.TokenizeLanguageAutoConfiguration,\ +org.apache.camel.language.tokenizer.springboot.XMLTokenizeLanguageAutoConfiguration + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java b/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java new file mode 100644 index 0000000..b5efa61 --- /dev/null +++ b/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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.groovy.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.groovy.GroovyLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(GroovyLanguageConfiguration.class) +public class GroovyLanguageAutoConfiguration { + + @Bean(name = "groovy-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(GroovyLanguage.class) + public GroovyLanguage configureGroovyLanguage(CamelContext camelContext, + GroovyLanguageConfiguration configuration) throws Exception { + GroovyLanguage language = new GroovyLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageConfiguration.java b/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageConfiguration.java new file mode 100644 index 0000000..8b34501 --- /dev/null +++ b/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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.groovy.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For Groovy expressions and predicates + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.groovy") +public class GroovyLanguageConfiguration { + + /** + * 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/53eba311/components/camel-groovy/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-groovy/src/main/resources/META-INF/spring.factories b/components/camel-groovy/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..51aabcc --- /dev/null +++ b/components/camel-groovy/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.language.groovy.springboot.GroovyLanguageAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java new file mode 100644 index 0000000..8a7994f --- /dev/null +++ b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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.component.hl7.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.component.hl7.TerserLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(TerserLanguageConfiguration.class) +public class TerserLanguageAutoConfiguration { + + @Bean(name = "terser-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(TerserLanguage.class) + public TerserLanguage configureTerserLanguage(CamelContext camelContext, + TerserLanguageConfiguration configuration) throws Exception { + TerserLanguage language = new TerserLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageConfiguration.java b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageConfiguration.java new file mode 100644 index 0000000..8551aa9 --- /dev/null +++ b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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.component.hl7.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For HL7 terser expressions and predicates + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.terser") +public class TerserLanguageConfiguration { + + /** + * 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/53eba311/components/camel-hl7/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-hl7/src/main/resources/META-INF/spring.factories b/components/camel-hl7/src/main/resources/META-INF/spring.factories index 581cf0e..4904bc2 100644 --- a/components/camel-hl7/src/main/resources/META-INF/spring.factories +++ b/components/camel-hl7/src/main/resources/META-INF/spring.factories @@ -16,4 +16,6 @@ # org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.apache.camel.component.hl7.springboot.HL7DataFormatAutoConfiguration +org.apache.camel.component.hl7.springboot.HL7DataFormatAutoConfiguration,\ +org.apache.camel.component.hl7.springboot.TerserLanguageAutoConfiguration + http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/components/camel-josql/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-josql/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageAutoConfiguration.java b/components/camel-josql/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageAutoConfiguration.java new file mode 100644 index 0000000..0a1a0e9 --- /dev/null +++ b/components/camel-josql/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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.sql.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.sql.SqlLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(SqlLanguageConfiguration.class) +public class SqlLanguageAutoConfiguration { + + @Bean(name = "sql-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SqlLanguage.class) + public SqlLanguage configureSqlLanguage(CamelContext camelContext, + SqlLanguageConfiguration configuration) throws Exception { + SqlLanguage language = new SqlLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/53eba311/components/camel-josql/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-josql/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageConfiguration.java b/components/camel-josql/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageConfiguration.java new file mode 100644 index 0000000..1816393 --- /dev/null +++ b/components/camel-josql/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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.sql.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For SQL expressions and predicates + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.sql") +public class SqlLanguageConfiguration { + + /** + * 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/53eba311/components/camel-josql/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components/camel-josql/src/main/resources/META-INF/spring.factories b/components/camel-josql/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..d23f300 --- /dev/null +++ b/components/camel-josql/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.language.sql.springboot.SqlLanguageAutoConfiguration