You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2020/10/09 18:45:29 UTC

[camel] branch master updated: CAMEL-15666: Fix PackageDataFormatMojo handling of classes with generic types (#4410)

This is an automated email from the ASF dual-hosted git repository.

janbednar 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 dab61fe  CAMEL-15666: Fix PackageDataFormatMojo handling of classes with generic types (#4410)
dab61fe is described below

commit dab61fe7e45a4002e7f88ec178244b30d7f8445f
Author: Jan Bednar <ma...@janbednar.eu>
AuthorDate: Fri Oct 9 20:45:04 2020 +0200

    CAMEL-15666: Fix PackageDataFormatMojo handling of classes with generic types (#4410)
---
 .../UniVocityCsvDataFormatConfigurer.java          | 25 ++++++++++++++++++++++
 .../UniVocityFixedWidthDataFormatConfigurer.java   | 25 ++++++++++++++++++++++
 .../UniVocityTsvDataFormatConfigurer.java          | 25 ++++++++++++++++++++++
 .../maven/packaging/PackageDataFormatMojo.java     |  3 ++-
 4 files changed, 77 insertions(+), 1 deletion(-)

diff --git a/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityCsvDataFormatConfigurer.java b/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityCsvDataFormatConfigurer.java
index a93ce18..bcf5734 100644
--- a/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityCsvDataFormatConfigurer.java
+++ b/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityCsvDataFormatConfigurer.java
@@ -24,6 +24,31 @@ public class UniVocityCsvDataFormatConfigurer extends PropertyConfigurerSupport
         case "quoteescape":
         case "quoteEscape": dataformat.setQuoteEscape(property(camelContext, java.lang.Character.class, value)); return true;
         case "delimiter": dataformat.setDelimiter(property(camelContext, java.lang.Character.class, value)); return true;
+        case "nullvalue":
+        case "nullValue": dataformat.setNullValue(property(camelContext, java.lang.String.class, value)); return true;
+        case "skipemptylines":
+        case "skipEmptyLines": dataformat.setSkipEmptyLines(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "ignoretrailingwhitespaces":
+        case "ignoreTrailingWhitespaces": dataformat.setIgnoreTrailingWhitespaces(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "ignoreleadingwhitespaces":
+        case "ignoreLeadingWhitespaces": dataformat.setIgnoreLeadingWhitespaces(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "headersdisabled":
+        case "headersDisabled": dataformat.setHeadersDisabled(property(camelContext, boolean.class, value)); return true;
+        case "headerextractionenabled":
+        case "headerExtractionEnabled": dataformat.setHeaderExtractionEnabled(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "numberofrecordstoread":
+        case "numberOfRecordsToRead": dataformat.setNumberOfRecordsToRead(property(camelContext, java.lang.Integer.class, value)); return true;
+        case "emptyvalue":
+        case "emptyValue": dataformat.setEmptyValue(property(camelContext, java.lang.String.class, value)); return true;
+        case "lineseparator":
+        case "lineSeparator": dataformat.setLineSeparator(property(camelContext, java.lang.String.class, value)); return true;
+        case "normalizedlineseparator":
+        case "normalizedLineSeparator": dataformat.setNormalizedLineSeparator(property(camelContext, java.lang.Character.class, value)); return true;
+        case "comment": dataformat.setComment(property(camelContext, java.lang.Character.class, value)); return true;
+        case "lazyload":
+        case "lazyLoad": dataformat.setLazyLoad(property(camelContext, boolean.class, value)); return true;
+        case "asmap":
+        case "asMap": dataformat.setAsMap(property(camelContext, boolean.class, value)); return true;
         default: return false;
         }
     }
diff --git a/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityFixedWidthDataFormatConfigurer.java b/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityFixedWidthDataFormatConfigurer.java
index 583a720..fd9721f 100644
--- a/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityFixedWidthDataFormatConfigurer.java
+++ b/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityFixedWidthDataFormatConfigurer.java
@@ -23,6 +23,31 @@ public class UniVocityFixedWidthDataFormatConfigurer extends PropertyConfigurerS
         case "recordendsonnewline":
         case "recordEndsOnNewline": dataformat.setRecordEndsOnNewline(property(camelContext, java.lang.Boolean.class, value)); return true;
         case "padding": dataformat.setPadding(property(camelContext, java.lang.Character.class, value)); return true;
+        case "nullvalue":
+        case "nullValue": dataformat.setNullValue(property(camelContext, java.lang.String.class, value)); return true;
+        case "skipemptylines":
+        case "skipEmptyLines": dataformat.setSkipEmptyLines(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "ignoretrailingwhitespaces":
+        case "ignoreTrailingWhitespaces": dataformat.setIgnoreTrailingWhitespaces(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "ignoreleadingwhitespaces":
+        case "ignoreLeadingWhitespaces": dataformat.setIgnoreLeadingWhitespaces(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "headersdisabled":
+        case "headersDisabled": dataformat.setHeadersDisabled(property(camelContext, boolean.class, value)); return true;
+        case "headerextractionenabled":
+        case "headerExtractionEnabled": dataformat.setHeaderExtractionEnabled(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "numberofrecordstoread":
+        case "numberOfRecordsToRead": dataformat.setNumberOfRecordsToRead(property(camelContext, java.lang.Integer.class, value)); return true;
+        case "emptyvalue":
+        case "emptyValue": dataformat.setEmptyValue(property(camelContext, java.lang.String.class, value)); return true;
+        case "lineseparator":
+        case "lineSeparator": dataformat.setLineSeparator(property(camelContext, java.lang.String.class, value)); return true;
+        case "normalizedlineseparator":
+        case "normalizedLineSeparator": dataformat.setNormalizedLineSeparator(property(camelContext, java.lang.Character.class, value)); return true;
+        case "comment": dataformat.setComment(property(camelContext, java.lang.Character.class, value)); return true;
+        case "lazyload":
+        case "lazyLoad": dataformat.setLazyLoad(property(camelContext, boolean.class, value)); return true;
+        case "asmap":
+        case "asMap": dataformat.setAsMap(property(camelContext, boolean.class, value)); return true;
         default: return false;
         }
     }
diff --git a/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityTsvDataFormatConfigurer.java b/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityTsvDataFormatConfigurer.java
index 12f46ec..2060584 100644
--- a/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityTsvDataFormatConfigurer.java
+++ b/components/camel-univocity-parsers/src/generated/java/org/apache/camel/dataformat/univocity/UniVocityTsvDataFormatConfigurer.java
@@ -20,6 +20,31 @@ public class UniVocityTsvDataFormatConfigurer extends PropertyConfigurerSupport
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "escapechar":
         case "escapeChar": dataformat.setEscapeChar(property(camelContext, java.lang.Character.class, value)); return true;
+        case "nullvalue":
+        case "nullValue": dataformat.setNullValue(property(camelContext, java.lang.String.class, value)); return true;
+        case "skipemptylines":
+        case "skipEmptyLines": dataformat.setSkipEmptyLines(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "ignoretrailingwhitespaces":
+        case "ignoreTrailingWhitespaces": dataformat.setIgnoreTrailingWhitespaces(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "ignoreleadingwhitespaces":
+        case "ignoreLeadingWhitespaces": dataformat.setIgnoreLeadingWhitespaces(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "headersdisabled":
+        case "headersDisabled": dataformat.setHeadersDisabled(property(camelContext, boolean.class, value)); return true;
+        case "headerextractionenabled":
+        case "headerExtractionEnabled": dataformat.setHeaderExtractionEnabled(property(camelContext, java.lang.Boolean.class, value)); return true;
+        case "numberofrecordstoread":
+        case "numberOfRecordsToRead": dataformat.setNumberOfRecordsToRead(property(camelContext, java.lang.Integer.class, value)); return true;
+        case "emptyvalue":
+        case "emptyValue": dataformat.setEmptyValue(property(camelContext, java.lang.String.class, value)); return true;
+        case "lineseparator":
+        case "lineSeparator": dataformat.setLineSeparator(property(camelContext, java.lang.String.class, value)); return true;
+        case "normalizedlineseparator":
+        case "normalizedLineSeparator": dataformat.setNormalizedLineSeparator(property(camelContext, java.lang.Character.class, value)); return true;
+        case "comment": dataformat.setComment(property(camelContext, java.lang.Character.class, value)); return true;
+        case "lazyload":
+        case "lazyLoad": dataformat.setLazyLoad(property(camelContext, boolean.class, value)); return true;
+        case "asmap":
+        case "asMap": dataformat.setAsMap(property(camelContext, boolean.class, value)); return true;
         default: return false;
         }
     }
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageDataFormatMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageDataFormatMojo.java
index 362dfa7..5f2f674 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageDataFormatMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageDataFormatMojo.java
@@ -515,7 +515,8 @@ public class PackageDataFormatMojo extends AbstractGeneratorMojo {
     private Optional<JavaClassSource> doParseJavaClassSource(String className) {
         try {
             Path srcDir = project.getBasedir().toPath().resolve("src/main/java");
-            Path file = srcDir.resolve(className.replace('.', '/') + ".java");
+            // Remove <.*> from className, as the string may contain generic types
+            Path file = srcDir.resolve(className.replaceAll("<.*>", "").replace('.', '/') + ".java");
             if (!Files.isRegularFile(file)) {
                 return Optional.empty();
             }