This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 1a779ad CAMEL-13118: Components should not depend on camel-core but camel-support 1a779ad is described below commit 1a779ad886bd1ec7664fe936dbd8839f5d7dbcac Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Apr 18 07:59:42 2019 +0200 CAMEL-13118: Components should not depend on camel-core but camel-support --- components/camel-bindy/pom.xml | 3 +-- .../src/main/docs/bindy-dataformat.adoc | 2 +- components/camel-snakeyaml/pom.xml | 3 +-- .../src/main/docs/yaml-snakeyaml-dataformat.adoc | 4 +--- .../camel/model/dataformat/BindyDataFormat.java | 2 +- .../BindyCsvDataFormatConfiguration.java | 9 ++++--- .../BindyFixedLengthDataFormatConfiguration.java | 9 ++++--- .../BindyKeyValuePairDataFormatConfiguration.java | 9 ++++--- .../SnakeYAMLDataFormatConfiguration.java | 28 ---------------------- .../packaging/SpringBootAutoConfigurationMojo.java | 9 ++++--- 10 files changed, 23 insertions(+), 55 deletions(-) diff --git a/components/camel-bindy/pom.xml b/components/camel-bindy/pom.xml index e023654..bf41a81 100644 --- a/components/camel-bindy/pom.xml +++ b/components/camel-bindy/pom.xml @@ -37,10 +37,9 @@ <dependencies> - <!-- requires camel-core --> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> + <artifactId>camel-support</artifactId> </dependency> <!-- testing --> diff --git a/components/camel-bindy/src/main/docs/bindy-dataformat.adoc b/components/camel-bindy/src/main/docs/bindy-dataformat.adoc index 7772c9e..9bfb8f4 100644 --- a/components/camel-bindy/src/main/docs/bindy-dataformat.adoc +++ b/components/camel-bindy/src/main/docs/bindy-dataformat.adoc @@ -63,7 +63,7 @@ The Bindy dataformat supports 5 options, which are listed below. [width="100%",cols="2s,1m,1m,6",options="header"] |=== | Name | Default | Java Type | Description -| type | | BindyType | Whether to use csv, fixed or key value pairs mode. The default value is either Csv or KeyValue depending on chosen dataformat. +| type | | BindyType | Whether to use Csv, Fixed, or KeyValue. The default value is either Csv or KeyValue depending on chosen dataformat. | classType | | String | Name of model class to use. | locale | | String | To configure a default locale to use, such as us for united states. To use the JVM platform default locale then use the name default | unwrapSingleInstance | true | Boolean | When unmarshalling should a single instance be unwrapped and returned instead of wrapped in a java.util.List. diff --git a/components/camel-snakeyaml/pom.xml b/components/camel-snakeyaml/pom.xml index feedf57..8d00fb2 100644 --- a/components/camel-snakeyaml/pom.xml +++ b/components/camel-snakeyaml/pom.xml @@ -34,10 +34,9 @@ <dependencies> - <!-- requires camel-core due dataformat --> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> + <artifactId>camel-support</artifactId> </dependency> <dependency> <groupId>org.yaml</groupId> diff --git a/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc b/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc index 5c905ac..544d9e1 100644 --- a/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc +++ b/components/camel-snakeyaml/src/main/docs/yaml-snakeyaml-dataformat.adoc @@ -54,7 +54,7 @@ When using Spring Boot make sure to use the following Maven dependency to have s ---- -The component supports 12 options, which are listed below. +The component supports 10 options, which are listed below. @@ -66,11 +66,9 @@ The component supports 12 options, which are listed below. | *camel.dataformat.yaml-snakeyaml.content-type-header* | 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. | false | Boolean | *camel.dataformat.yaml-snakeyaml.dumper-options* | DumperOptions to configure outgoing objects. | | String | *camel.dataformat.yaml-snakeyaml.enabled* | Enable yaml-snakeyaml dataformat | true | Boolean -| *camel.dataformat.yaml-snakeyaml.library* | Which yaml library to use. By default it is SnakeYAML | | YAMLLibrary | *camel.dataformat.yaml-snakeyaml.pretty-flow* | Force the emitter to produce a pretty YAML document when using the flow style. | false | Boolean | *camel.dataformat.yaml-snakeyaml.representer* | Representer to emit outgoing objects. | | String | *camel.dataformat.yaml-snakeyaml.resolver* | Resolver to detect implicit type | | String -| *camel.dataformat.yaml-snakeyaml.type-filter* | Set the types SnakeYAML is allowed to un-marshall | | List | *camel.dataformat.yaml-snakeyaml.unmarshal-type-name* | Class name of the java type to use when unarmshalling | | String | *camel.dataformat.yaml-snakeyaml.use-application-context-class-loader* | Use ApplicationContextClassLoader as custom ClassLoader | true | Boolean |=== diff --git a/core/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyDataFormat.java b/core/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyDataFormat.java index 5bd7473..3962f72 100644 --- a/core/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyDataFormat.java +++ b/core/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyDataFormat.java @@ -56,7 +56,7 @@ public class BindyDataFormat extends DataFormatDefinition { } /** - * Whether to use csv, fixed or key value pairs mode. + * Whether to use Csv, Fixed, or KeyValue. */ public void setType(BindyType type) { this.type = type; diff --git a/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java index a80e92c..696cb10 100644 --- a/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java @@ -17,7 +17,6 @@ package org.apache.camel.dataformat.bindy.csv.springboot; import javax.annotation.Generated; -import org.apache.camel.model.dataformat.BindyType; import org.apache.camel.spring.boot.DataFormatConfigurationPropertiesCommon; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -39,9 +38,9 @@ public class BindyCsvDataFormatConfiguration */ private Boolean enabled; /** - * Whether to use csv, fixed or key value pairs mode. + * Whether to use Csv, Fixed, or KeyValue. */ - private BindyType type; + private String type; /** * Name of model class to use. */ @@ -64,11 +63,11 @@ public class BindyCsvDataFormatConfiguration */ private Boolean contentTypeHeader = false; - public BindyType getType() { + public String getType() { return type; } - public void setType(BindyType type) { + public void setType(String type) { this.type = type; } diff --git a/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java index b10f295..eb354f8 100644 --- a/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java @@ -17,7 +17,6 @@ package org.apache.camel.dataformat.bindy.fixed.springboot; import javax.annotation.Generated; -import org.apache.camel.model.dataformat.BindyType; import org.apache.camel.spring.boot.DataFormatConfigurationPropertiesCommon; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -39,9 +38,9 @@ public class BindyFixedLengthDataFormatConfiguration */ private Boolean enabled; /** - * Whether to use csv, fixed or key value pairs mode. + * Whether to use Csv, Fixed, or KeyValue. */ - private BindyType type; + private String type; /** * Name of model class to use. */ @@ -64,11 +63,11 @@ public class BindyFixedLengthDataFormatConfiguration */ private Boolean contentTypeHeader = false; - public BindyType getType() { + public String getType() { return type; } - public void setType(BindyType type) { + public void setType(String type) { this.type = type; } diff --git a/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java index 8368f80..a3392ed 100644 --- a/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java @@ -17,7 +17,6 @@ package org.apache.camel.dataformat.bindy.kvp.springboot; import javax.annotation.Generated; -import org.apache.camel.model.dataformat.BindyType; import org.apache.camel.spring.boot.DataFormatConfigurationPropertiesCommon; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -39,9 +38,9 @@ public class BindyKeyValuePairDataFormatConfiguration */ private Boolean enabled; /** - * Whether to use csv, fixed or key value pairs mode. + * Whether to use Csv, Fixed, or KeyValue. */ - private BindyType type; + private String type; /** * Name of model class to use. */ @@ -64,11 +63,11 @@ public class BindyKeyValuePairDataFormatConfiguration */ private Boolean contentTypeHeader = false; - public BindyType getType() { + public String getType() { return type; } - public void setType(BindyType type) { + public void setType(String type) { this.type = type; } diff --git a/platforms/spring-boot/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatConfiguration.java index 0253192..b5e946d 100644 --- a/platforms/spring-boot/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatConfiguration.java @@ -16,11 +16,7 @@ */ package org.apache.camel.component.snakeyaml.springboot; -import java.util.List; import javax.annotation.Generated; -import org.apache.camel.component.snakeyaml.SnakeYAMLDataFormat; -import org.apache.camel.model.dataformat.YAMLLibrary; -import org.apache.camel.model.dataformat.YAMLTypeFilterDefinition; import org.apache.camel.spring.boot.DataFormatConfigurationPropertiesCommon; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -41,10 +37,6 @@ public class SnakeYAMLDataFormatConfiguration */ private Boolean enabled; /** - * Which yaml library to use. By default it is SnakeYAML - */ - private YAMLLibrary library = YAMLLibrary.SnakeYAML; - /** * Class name of the java type to use when unarmshalling */ private String unmarshalTypeName; @@ -78,10 +70,6 @@ public class SnakeYAMLDataFormatConfiguration */ private Boolean allowAnyType = false; /** - * Set the types SnakeYAML is allowed to un-marshall - */ - private List<YAMLTypeFilterDefinition> typeFilter; - /** * 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 @@ -89,14 +77,6 @@ public class SnakeYAMLDataFormatConfiguration */ private Boolean contentTypeHeader = false; - public YAMLLibrary getLibrary() { - return library; - } - - public void setLibrary(YAMLLibrary library) { - this.library = library; - } - public String getUnmarshalTypeName() { return unmarshalTypeName; } @@ -162,14 +142,6 @@ public class SnakeYAMLDataFormatConfiguration this.allowAnyType = allowAnyType; } - public List<YAMLTypeFilterDefinition> getTypeFilter() { - return typeFilter; - } - - public void setTypeFilter(List<YAMLTypeFilterDefinition> typeFilter) { - this.typeFilter = typeFilter; - } - public Boolean getContentTypeHeader() { return contentTypeHeader; } diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java index adfa121..139915e 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java @@ -1336,8 +1336,12 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { String type = option.getJavaType(); type = getSimpleJavaType(type); - // skip options for json based-data formats as these are implied - if ("org.apache.camel.model.dataformat.JsonLibrary".equals(type)) { + // special for bindy + if ("org.apache.camel.model.dataformat.BindyType".equals(option.getJavaType())) { + // force to use a string type + type = "java.lang.String"; + } else if (option.getJavaType().contains("org.apache.camel.model.dataformat")) { + // skip options that are from the model as they are not possible to configure anyway continue; } @@ -1356,7 +1360,6 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { type = "java.lang.String"; } - Property prop = javaClass.addProperty(type, option.getName()); if ("true".equals(option.getDeprecated())) { prop.getField().addAnnotation(Deprecated.class);