[1/4] camel git commit: CAMEL-10847: Component json schema - Include display name for options

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[1/4] camel git commit: CAMEL-10847: Component json schema - Include display name for options

davsclaus-2
Repository: camel
Updated Branches:
  refs/heads/master 2fc3f5489 -> fc39180dc


CAMEL-10847: Component json schema - Include display name for options


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/78634db1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/78634db1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/78634db1

Branch: refs/heads/master
Commit: 78634db19316716db9a957f66351c2d41e7d10a0
Parents: 2fc3f54
Author: Claus Ibsen <[hidden email]>
Authored: Thu Feb 16 19:44:05 2017 +0100
Committer: Claus Ibsen <[hidden email]>
Committed: Thu Feb 16 19:44:05 2017 +0100

----------------------------------------------------------------------
 .../tools/apt/CoreEipAnnotationProcessor.java   | 106 ++++++++++++++-----
 .../tools/apt/EndpointAnnotationProcessor.java  |  15 +--
 .../tools/apt/SpringAnnotationProcessor.java    |  36 +++++--
 .../tools/apt/helper/JsonSchemaHelper.java      |   8 +-
 .../camel/tools/apt/model/ComponentOption.java  |   8 +-
 .../camel/tools/apt/model/EndpointOption.java   |   8 +-
 .../camel/tools/apt/model/EndpointPath.java     |   8 +-
 .../tools/apt/EndpointOptionComparatorTest.java |   8 +-
 .../java/org/apache/camel/spi/Metadata.java     |   7 ++
 .../java/org/apache/camel/spi/UriParam.java     |   7 ++
 .../main/java/org/apache/camel/spi/UriPath.java |   7 ++
 11 files changed, 168 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/78634db1/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessor.java
index b1293b5..737df54 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessor.java
@@ -190,7 +190,7 @@ public class CoreEipAnnotationProcessor {
             // as its json we need to sanitize the docs
             String doc = entry.getDocumentation();
             doc = sanitizeDescription(doc, false);
-            buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getKind(), entry.isRequired(), entry.getType(), entry.getDefaultValue(), doc,
+            buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(), entry.getKind(), entry.isRequired(), entry.getType(), entry.getDefaultValue(), doc,
                     entry.isDeprecated(), false, null, null, entry.isEnumType(), entry.getEnums(), entry.isOneOf(), entry.getOneOfTypes(),
                     entry.isAsPredicate(), null, null, false));
         }
@@ -366,8 +366,13 @@ public class CoreEipAnnotationProcessor {
         }
 
         boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
+        String displayName = null;
+        Metadata metadata = fieldElement.getAnnotation(Metadata.class);
+        if (metadata != null) {
+            displayName = metadata.displayName();
+        }
 
-        EipOption ep = new EipOption(name, "attribute", fieldTypeName, required, defaultValue, docComment, deprecated, isEnum, enums, false, null, false);
+        EipOption ep = new EipOption(name, displayName,"attribute", fieldTypeName, required, defaultValue, docComment, deprecated, isEnum, enums, false, null, false);
         eipOptions.add(ep);
 
         return false;
@@ -399,8 +404,13 @@ public class CoreEipAnnotationProcessor {
         required = findRequired(fieldElement, required);
 
         boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
+        String displayName = null;
+        Metadata metadata = fieldElement.getAnnotation(Metadata.class);
+        if (metadata != null) {
+            displayName = metadata.displayName();
+        }
 
-        EipOption ep = new EipOption(name, "value", fieldTypeName, required, defaultValue, docComment, deprecated, false, null, false, null, false);
+        EipOption ep = new EipOption(name, displayName,"value", fieldTypeName, required, defaultValue, docComment, deprecated, false, null, false, null, false);
         eipOptions.add(ep);
     }
 
@@ -482,8 +492,13 @@ public class CoreEipAnnotationProcessor {
             }
 
             boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
+            String displayName = null;
+            Metadata metadata = fieldElement.getAnnotation(Metadata.class);
+            if (metadata != null) {
+                displayName = metadata.displayName();
+            }
 
-            EipOption ep = new EipOption(name, kind, fieldTypeName, required, defaultValue, docComment, deprecated, isEnum, enums, isOneOf, oneOfTypes, asPredicate);
+            EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, required, defaultValue, docComment, deprecated, isEnum, enums, isOneOf, oneOfTypes, asPredicate);
             eipOptions.add(ep);
         }
     }
@@ -515,7 +530,13 @@ public class CoreEipAnnotationProcessor {
                 oneOfTypes.add(child);
             }
 
-            EipOption ep = new EipOption(name, kind, fieldTypeName, required, defaultValue, docComment, false, false, null, true, oneOfTypes, false);
+            String displayName = null;
+            Metadata metadata = fieldElement.getAnnotation(Metadata.class);
+            if (metadata != null) {
+                displayName = metadata.displayName();
+            }
+
+            EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, required, defaultValue, docComment, false, false, null, true, oneOfTypes, false);
             eipOptions.add(ep);
         }
     }
@@ -527,52 +548,52 @@ public class CoreEipAnnotationProcessor {
 
         // group
         String docComment = findJavaDoc(elementUtils, null, "group", null, classElement, true);
-        EipOption ep = new EipOption("group", "attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
+        EipOption ep = new EipOption("group", "Group","attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // group
         docComment = findJavaDoc(elementUtils, null, "streamCache", null, classElement, true);
-        ep = new EipOption("streamCache", "attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
+        ep = new EipOption("streamCache", "Stream Cache","attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // trace
         docComment = findJavaDoc(elementUtils, null, "trace", null, classElement, true);
-        ep = new EipOption("trace", "attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
+        ep = new EipOption("trace", "Trace","attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // trace
         docComment = findJavaDoc(elementUtils, null, "messageHistory", null, classElement, true);
-        ep = new EipOption("messageHistory", "attribute", "java.lang.String", false, "true", docComment, false, false, null, false, null, false);
+        ep = new EipOption("messageHistory", "Message History","attribute", "java.lang.String", false, "true", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // trace
         docComment = findJavaDoc(elementUtils, null, "handleFault", null, classElement, true);
-        ep = new EipOption("handleFault", "attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
+        ep = new EipOption("handleFault", "Handle Fault","attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // delayer
         docComment = findJavaDoc(elementUtils, null, "delayer", null, classElement, true);
-        ep = new EipOption("delayer", "attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
+        ep = new EipOption("delayer", "Delayer","attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // autoStartup
         docComment = findJavaDoc(elementUtils, null, "autoStartup", null, classElement, true);
-        ep = new EipOption("autoStartup", "attribute", "java.lang.String", false, "true", docComment, false, false, null, false, null, false);
+        ep = new EipOption("autoStartup", "Auto Startup","attribute", "java.lang.String", false, "true", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // startupOrder
         docComment = findJavaDoc(elementUtils, null, "startupOrder", null, classElement, true);
-        ep = new EipOption("startupOrder", "attribute", "java.lang.Integer", false, "", docComment, false, false, null, false, null, false);
+        ep = new EipOption("startupOrder", "Startup Order","attribute", "java.lang.Integer", false, "", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // errorHandlerRef
         docComment = findJavaDoc(elementUtils, null, "errorHandlerRef", null, classElement, true);
-        ep = new EipOption("errorHandlerRef", "attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
+        ep = new EipOption("errorHandlerRef", "Error Handler","attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // routePolicyRef
         docComment = findJavaDoc(elementUtils, null, "routePolicyRef", null, classElement, true);
-        ep = new EipOption("routePolicyRef", "attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
+        ep = new EipOption("routePolicyRef", "Route Policy","attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // shutdownRoute
@@ -580,7 +601,7 @@ public class CoreEipAnnotationProcessor {
         enums.add("Default");
         enums.add("Defer");
         docComment = findJavaDoc(elementUtils, null, "shutdownRoute", "Default", classElement, true);
-        ep = new EipOption("shutdownRoute", "attribute", "org.apache.camel.ShutdownRoute", false, "", docComment, false, true, enums, false, null, false);
+        ep = new EipOption("shutdownRoute", "Shutdown Route","attribute", "org.apache.camel.ShutdownRoute", false, "", docComment, false, true, enums, false, null, false);
         eipOptions.add(ep);
 
         // shutdownRunningTask
@@ -588,14 +609,14 @@ public class CoreEipAnnotationProcessor {
         enums.add("CompleteCurrentTaskOnly");
         enums.add("CompleteAllTasks");
         docComment = findJavaDoc(elementUtils, null, "shutdownRunningTask", "CompleteCurrentTaskOnly", classElement, true);
-        ep = new EipOption("shutdownRunningTask", "attribute", "org.apache.camel.ShutdownRunningTask", false, "", docComment, false, true, enums, false, null, false);
+        ep = new EipOption("shutdownRunningTask", "Shutdown Running Task", "attribute", "org.apache.camel.ShutdownRunningTask", false, "", docComment, false, true, enums, false, null, false);
         eipOptions.add(ep);
 
         // inputs
         Set<String> oneOfTypes = new TreeSet<String>();
         oneOfTypes.add("from");
         docComment = findJavaDoc(elementUtils, null, "inputs", null, classElement, true);
-        ep = new EipOption("inputs", "element", "java.util.List<org.apache.camel.model.FromDefinition>", true, "", docComment, false, false, null, true, oneOfTypes, false);
+        ep = new EipOption("inputs", "Inputs","element", "java.util.List<org.apache.camel.model.FromDefinition>", true, "", docComment, false, false, null, true, oneOfTypes, false);
         eipOptions.add(ep);
 
         // outputs
@@ -618,7 +639,7 @@ public class CoreEipAnnotationProcessor {
         oneOfTypes.remove("route");
 
         docComment = findJavaDoc(elementUtils, null, "outputs", null, classElement, true);
-        ep = new EipOption("outputs", "element", "java.util.List<org.apache.camel.model.ProcessorDefinition<?>>", true, "", docComment, false, false, null, true, oneOfTypes, false);
+        ep = new EipOption("outputs", "Outputs","element", "java.util.List<org.apache.camel.model.ProcessorDefinition<?>>", true, "", docComment, false, false, null, true, oneOfTypes, false);
         eipOptions.add(ep);
     }
 
@@ -632,19 +653,19 @@ public class CoreEipAnnotationProcessor {
 
         // id
         String docComment = findJavaDoc(elementUtils, null, "id", null, classElement, true);
-        EipOption ep = new EipOption("id", "attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
+        EipOption ep = new EipOption("id", "Id","attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // description
         docComment = findJavaDoc(elementUtils, null, "description", null, classElement, true);
-        ep = new EipOption("description", "element", "org.apache.camel.model.DescriptionDefinition", false, "", docComment, false, false, null, false, null, false);
+        ep = new EipOption("description", "Description","element", "org.apache.camel.model.DescriptionDefinition", false, "", docComment, false, false, null, false, null, false);
         eipOptions.add(ep);
 
         // lets skip custom id as it has no value for end users to configure
         if (!skipUnwanted) {
             // custom id
             docComment = findJavaDoc(elementUtils, null, "customId", null, classElement, true);
-            ep = new EipOption("customId", "attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
+            ep = new EipOption("customId", "Custom Id","attribute", "java.lang.String", false, "", docComment, false, false, null, false, null, false);
             eipOptions.add(ep);
         }
     }
@@ -662,7 +683,7 @@ public class CoreEipAnnotationProcessor {
             Set<String> oneOfTypes = new TreeSet<String>();
             oneOfTypes.add("route");
 
-            EipOption ep = new EipOption("routes", "element", fieldTypeName, false, "", "Contains the Camel routes", false, false, null, true, oneOfTypes, false);
+            EipOption ep = new EipOption("routes", "Routes","element", fieldTypeName, false, "", "Contains the Camel routes", false, false, null, true, oneOfTypes, false);
             eipOptions.add(ep);
         }
     }
@@ -680,7 +701,7 @@ public class CoreEipAnnotationProcessor {
             Set<String> oneOfTypes = new TreeSet<String>();
             oneOfTypes.add("rest");
 
-            EipOption ep = new EipOption("rests", "element", fieldTypeName, false, "", "Contains the rest services defined using the rest-dsl", false, false, null, true, oneOfTypes, false);
+            EipOption ep = new EipOption("rests", "Rests","element", fieldTypeName, false, "", "Contains the rest services defined using the rest-dsl", false, false, null, true, oneOfTypes, false);
             eipOptions.add(ep);
         }
     }
@@ -717,8 +738,13 @@ public class CoreEipAnnotationProcessor {
 
             // remove some types which are not intended as an output in eips
             oneOfTypes.remove("route");
+            String displayName = null;
+            Metadata metadata = fieldElement.getAnnotation(Metadata.class);
+            if (metadata != null) {
+                displayName = metadata.displayName();
+            }
 
-            EipOption ep = new EipOption(name, kind, fieldTypeName, true, "", "", false, false, null, true, oneOfTypes, false);
+            EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, true, "", "", false, false, null, true, oneOfTypes, false);
             eipOptions.add(ep);
         }
     }
@@ -759,8 +785,13 @@ public class CoreEipAnnotationProcessor {
                     }
                 }
             }
+            String displayName = null;
+            Metadata metadata = fieldElement.getAnnotation(Metadata.class);
+            if (metadata != null) {
+                displayName = metadata.displayName();
+            }
 
-            EipOption ep = new EipOption(name, kind, fieldTypeName, true, "", docComment, false, false, null, true, oneOfTypes, false);
+            EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, true, "", docComment, false, false, null, true, oneOfTypes, false);
             eipOptions.add(ep);
         }
     }
@@ -813,8 +844,13 @@ public class CoreEipAnnotationProcessor {
             }
 
             boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
+            String displayName = null;
+            Metadata metadata = fieldElement.getAnnotation(Metadata.class);
+            if (metadata != null) {
+                displayName = metadata.displayName();
+            }
 
-            EipOption ep = new EipOption(name, kind, fieldTypeName, true, "", docComment, deprecated, false, null, true, oneOfTypes, asPredicate);
+            EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, true, "", docComment, deprecated, false, null, true, oneOfTypes, asPredicate);
             eipOptions.add(ep);
         }
     }
@@ -847,7 +883,13 @@ public class CoreEipAnnotationProcessor {
             // when is predicate
             boolean asPredicate = true;
 
-            EipOption ep = new EipOption(name, kind, fieldTypeName, false, "", docComment, deprecated, false, null, true, oneOfTypes, asPredicate);
+            String displayName = null;
+            Metadata metadata = fieldElement.getAnnotation(Metadata.class);
+            if (metadata != null) {
+                displayName = metadata.displayName();
+            }
+
+            EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, false, "", docComment, deprecated, false, null, true, oneOfTypes, asPredicate);
             eipOptions.add(ep);
         }
     }
@@ -1032,6 +1074,7 @@ public class CoreEipAnnotationProcessor {
     private static final class EipOption {
 
         private String name;
+        private String displayName;
         private String kind;
         private String type;
         private boolean required;
@@ -1044,9 +1087,10 @@ public class CoreEipAnnotationProcessor {
         private Set<String> oneOfTypes;
         private boolean asPredicate;
 
-        private EipOption(String name, String kind, String type, boolean required, String defaultValue, String documentation, boolean deprecated,
+        private EipOption(String name, String displayName, String kind, String type, boolean required, String defaultValue, String documentation, boolean deprecated,
                           boolean enumType, Set<String> enums, boolean oneOf, Set<String> oneOfTypes, boolean asPredicate) {
             this.name = name;
+            this.displayName = displayName;
             this.kind = kind;
             this.type = type;
             this.required = required;
@@ -1064,6 +1108,10 @@ public class CoreEipAnnotationProcessor {
             return name;
         }
 
+        public String getDisplayName() {
+            return displayName;
+        }
+
         public String getKind() {
             return kind;
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/78634db1/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index e962ad4..72a25cb 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -224,7 +224,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
             boolean multiValue = false;
             boolean asPredicate = false;
 
-            buffer.append(JsonSchemaHelper.toJson(entry.getName(), "property", required, entry.getType(), defaultValue, doc,
+            buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(),"property", required, entry.getType(), defaultValue, doc,
                 entry.isDeprecated(), entry.isSecret(), entry.getGroup(), entry.getLabel(), entry.isEnumType(), entry.getEnums(),
                 false, null, asPredicate, optionalPrefix, prefix, multiValue));
         }
@@ -276,7 +276,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
             boolean multiValue = false;
             boolean asPredicate = false;
 
-            buffer.append(JsonSchemaHelper.toJson(entry.getName(), "path", required, entry.getType(), defaultValue, doc,
+            buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(),"path", required, entry.getType(), defaultValue, doc,
                 entry.isDeprecated(), entry.isSecret(), entry.getGroup(), entry.getLabel(), entry.isEnumType(), entry.getEnums(),
                 false, null, asPredicate, optionalPrefix, prefix, multiValue));
         }
@@ -322,7 +322,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
             boolean multiValue = entry.isMultiValue();
             boolean asPredicate = false;
 
-            buffer.append(JsonSchemaHelper.toJson(entry.getName(), "parameter", required, entry.getType(), defaultValue,
+            buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(), "parameter", required, entry.getType(), defaultValue,
                 doc, entry.isDeprecated(), entry.isSecret(), entry.getGroup(), entry.getLabel(), entry.isEnumType(), entry.getEnums(),
                 false, null, asPredicate, optionalPrefix, prefix, multiValue));
         }
@@ -459,6 +459,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                 String required = metadata != null ? metadata.required() : null;
                 String label = metadata != null ? metadata.label() : null;
                 boolean secret = metadata != null && metadata.secret();
+                String displayName = metadata != null ? metadata.displayName() : null;
 
                 // we do not yet have default values / notes / as no annotation support yet
                 // String defaultValueNote = param.defaultValueNote();
@@ -513,7 +514,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                 }
 
                 String group = EndpointHelper.labelAsGroupName(label, componentModel.isConsumerOnly(), componentModel.isProducerOnly());
-                ComponentOption option = new ComponentOption(name, fieldTypeName, required, defaultValue, defaultValueNote,
+                ComponentOption option = new ComponentOption(name, displayName, fieldTypeName, required, defaultValue, defaultValueNote,
                         docComment.trim(), deprecated, secret, group, label, isEnum, enums);
                 componentOptions.add(option);
             }
@@ -569,6 +570,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                     if (Strings.isNullOrEmpty(label) && metadata != null) {
                         label = metadata.label();
                     }
+                    String displayName = metadata != null ? metadata.displayName() : null;
 
                     TypeMirror fieldType = fieldElement.asType();
                     String fieldTypeName = fieldType.toString();
@@ -613,7 +615,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
 
                     String group = EndpointHelper.labelAsGroupName(label, componentModel.isConsumerOnly(), componentModel.isProducerOnly());
                     boolean isSecret = secret != null ? secret : false;
-                    EndpointPath ep = new EndpointPath(name, fieldTypeName, required, defaultValue, docComment, deprecated, isSecret, group, label, isEnum, enums);
+                    EndpointPath ep = new EndpointPath(name, displayName, fieldTypeName, required, defaultValue, docComment, deprecated, isSecret, group, label, isEnum, enums);
                     endpointPaths.add(ep);
                 }
 
@@ -644,6 +646,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                     if (Strings.isNullOrEmpty(label) && metadata != null) {
                         label = metadata.label();
                     }
+                    String displayName = metadata != null ? metadata.displayName() : null;
 
                     // if the field type is a nested parameter then iterate through its fields
                     TypeMirror fieldType = fieldElement.asType();
@@ -703,7 +706,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
 
                         boolean isSecret = secret != null ? secret : param.secret();
                         String group = EndpointHelper.labelAsGroupName(label, componentModel.isConsumerOnly(), componentModel.isProducerOnly());
-                        EndpointOption option = new EndpointOption(name, fieldTypeName, required, defaultValue, defaultValueNote,
+                        EndpointOption option = new EndpointOption(name, displayName, fieldTypeName, required, defaultValue, defaultValueNote,
                                 docComment.trim(), paramOptionalPrefix, paramPrefix, multiValue, deprecated, isSecret, group, label, isEnum, enums);
                         endpointOptions.add(option);
                     }

http://git-wip-us.apache.org/repos/asf/camel/blob/78634db1/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessor.java
index 108386b..f6def82 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessor.java
@@ -148,7 +148,7 @@ public class SpringAnnotationProcessor {
             String doc = entry.getDocumentation();
             doc = sanitizeDescription(doc, false);
 
-            buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getKind(), entry.isRequired(), entry.getType(), entry.getDefaultValue(), doc,
+            buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(), entry.getKind(), entry.isRequired(), entry.getType(), entry.getDefaultValue(), doc,
                     entry.isDeprecated(), false, null, null, entry.isEnumType(), entry.getEnums(), entry.isOneOf(), entry.getOneOfTypes(), entry.isAsPredicate(),
                 null, null, false));
         }
@@ -287,6 +287,11 @@ public class SpringAnnotationProcessor {
         }
 
         boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
+        String displayName = null;
+        Metadata metadata = fieldElement.getAnnotation(Metadata.class);
+        if (metadata != null) {
+            displayName = metadata.displayName();
+        }
 
         // special for id as its inherited from camel-core
         if ("id".equals(name) && isNullOrEmpty(docComment)) {
@@ -297,7 +302,7 @@ public class SpringAnnotationProcessor {
             }
         }
 
-        EipOption ep = new EipOption(name, "attribute", fieldTypeName, required, defaultValue, docComment, deprecated, isEnum, enums, false, null, false);
+        EipOption ep = new EipOption(name, displayName, "attribute", fieldTypeName, required, defaultValue, docComment, deprecated, isEnum, enums, false, null, false);
         eipOptions.add(ep);
 
         return false;
@@ -315,7 +320,7 @@ public class SpringAnnotationProcessor {
         Set<String> oneOfTypes = new TreeSet<String>();
         oneOfTypes.add("route");
 
-        EipOption ep = new EipOption("route", "element", fieldTypeName, false, "", "Contains the Camel routes", false, false, null, true, oneOfTypes, false);
+        EipOption ep = new EipOption("route", "Route","element", fieldTypeName, false, "", "Contains the Camel routes", false, false, null, true, oneOfTypes, false);
         eipOptions.add(ep);
     }
 
@@ -331,7 +336,7 @@ public class SpringAnnotationProcessor {
         Set<String> oneOfTypes = new TreeSet<String>();
         oneOfTypes.add("rest");
 
-        EipOption ep = new EipOption("rest", "element", fieldTypeName, false, "", "Contains the rest services defined using the rest-dsl", false, false, null, true, oneOfTypes, false);
+        EipOption ep = new EipOption("rest", "Rest","element", fieldTypeName, false, "", "Contains the rest services defined using the rest-dsl", false, false, null, true, oneOfTypes, false);
         eipOptions.add(ep);
     }
 
@@ -410,8 +415,13 @@ public class SpringAnnotationProcessor {
 
             boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
             boolean asPredicate = false;
+            String displayName = null;
+            Metadata metadata = fieldElement.getAnnotation(Metadata.class);
+            if (metadata != null) {
+                displayName = metadata.displayName();
+            }
 
-            EipOption ep = new EipOption(name, kind, fieldTypeName, required, defaultValue, docComment, deprecated, isEnum, enums, oneOf, oneOfTypes, asPredicate);
+            EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, required, defaultValue, docComment, deprecated, isEnum, enums, oneOf, oneOfTypes, asPredicate);
             eipOptions.add(ep);
         }
     }
@@ -446,7 +456,13 @@ public class SpringAnnotationProcessor {
                 String child = element.name();
                 oneOfTypes.add(child);
             }
-            EipOption ep = new EipOption(name, kind, fieldTypeName, required, defaultValue, docComment, false, false, null, true, oneOfTypes, false);
+            String displayName = null;
+            Metadata metadata = fieldElement.getAnnotation(Metadata.class);
+            if (metadata != null) {
+                displayName = metadata.displayName();
+            }
+
+            EipOption ep = new EipOption(name, kind, displayName, fieldTypeName, required, defaultValue, docComment, false, false, null, true, oneOfTypes, false);
             eipOptions.add(ep);
         }
     }
@@ -555,6 +571,7 @@ public class SpringAnnotationProcessor {
     private static final class EipOption {
 
         private String name;
+        private String displayName;
         private String kind;
         private String type;
         private boolean required;
@@ -567,9 +584,10 @@ public class SpringAnnotationProcessor {
         private Set<String> oneOfTypes;
         private boolean asPredicate;
 
-        private EipOption(String name, String kind, String type, boolean required, String defaultValue, String documentation, boolean deprecated,
+        private EipOption(String name, String displayName, String kind, String type, boolean required, String defaultValue, String documentation, boolean deprecated,
                           boolean enumType, Set<String> enums, boolean oneOf, Set<String> oneOfTypes, boolean asPredicate) {
             this.name = name;
+            this.displayName = displayName;
             this.kind = kind;
             this.type = type;
             this.required = required;
@@ -587,6 +605,10 @@ public class SpringAnnotationProcessor {
             return name;
         }
 
+        public String getDisplayName() {
+            return displayName;
+        }
+
         public String getKind() {
             return kind;
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/78634db1/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java
index a8df312..b5c8264 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java
@@ -41,7 +41,7 @@ public final class JsonSchemaHelper {
     private JsonSchemaHelper() {
     }
 
-    public static String toJson(String name, String kind, Boolean required, String type, String defaultValue, String description,
+    public static String toJson(String name, String displayName, String kind, Boolean required, String type, String defaultValue, String description,
                                 Boolean deprecated, Boolean secret, String group, String label, boolean enumType, Set<String> enums,
                                 boolean oneOfType, Set<String> oneOffTypes, boolean asPredicate, String optionalPrefix, String prefix, boolean multiValue) {
         String typeName = JsonSchemaHelper.getType(type, enumType);
@@ -51,6 +51,12 @@ public final class JsonSchemaHelper {
         sb.append(": { \"kind\": ");
         sb.append(Strings.doubleQuote(kind));
 
+        // we want display name early so its easier to spot
+        if (!Strings.isNullOrEmpty(displayName)) {
+            sb.append(", \"displayName\": ");
+            sb.append(Strings.doubleQuote(label));
+        }
+
         // we want group early so its easier to spot
         if (!Strings.isNullOrEmpty(group)) {
             sb.append(", \"group\": ");

http://git-wip-us.apache.org/repos/asf/camel/blob/78634db1/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentOption.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentOption.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentOption.java
index 51b72dc..eae23de 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentOption.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentOption.java
@@ -25,6 +25,7 @@ import static org.apache.camel.tools.apt.helper.Strings.isNullOrEmpty;
 public final class ComponentOption {
 
     private String name;
+    private String displayName;
     private String type;
     private String required;
     private String defaultValue;
@@ -37,10 +38,11 @@ public final class ComponentOption {
     private boolean enumType;
     private Set<String> enums;
 
-    public ComponentOption(String name, String type, String required, String defaultValue, String defaultValueNote,
+    public ComponentOption(String name, String displayName, String type, String required, String defaultValue, String defaultValueNote,
                            String documentation, boolean deprecated, boolean secret, String group, String label,
                            boolean enumType, Set<String> enums) {
         this.name = name;
+        this.displayName = displayName;
         this.type = type;
         this.required = required;
         this.defaultValue = defaultValue;
@@ -58,6 +60,10 @@ public final class ComponentOption {
         return name;
     }
 
+    public String getDisplayName() {
+        return displayName;
+    }
+
     public String getType() {
         return type;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/78634db1/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointOption.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointOption.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointOption.java
index aaeb2bd..d20bdf4 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointOption.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointOption.java
@@ -25,6 +25,7 @@ import static org.apache.camel.tools.apt.helper.Strings.isNullOrEmpty;
 public final class EndpointOption {
 
     private String name;
+    private String displayName;
     private String type;
     private String required;
     private String defaultValue;
@@ -40,11 +41,12 @@ public final class EndpointOption {
     private boolean enumType;
     private Set<String> enums;
 
-    public EndpointOption(String name, String type, String required, String defaultValue, String defaultValueNote,
+    public EndpointOption(String name, String displayName, String type, String required, String defaultValue, String defaultValueNote,
                           String documentation, String optionalPrefix, String prefix, boolean multiValue,
                           boolean deprecated, boolean secret, String group, String label,
                           boolean enumType, Set<String> enums) {
         this.name = name;
+        this.displayName = displayName;
         this.type = type;
         this.required = required;
         this.defaultValue = defaultValue;
@@ -65,6 +67,10 @@ public final class EndpointOption {
         return name;
     }
 
+    public String getDisplayName() {
+        return displayName;
+    }
+
     public String getType() {
         return type;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/78634db1/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointPath.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointPath.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointPath.java
index 0c5fdef..f422b85 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointPath.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointPath.java
@@ -23,6 +23,7 @@ import org.apache.camel.tools.apt.helper.CollectionStringBuffer;
 public final class EndpointPath {
 
     private String name;
+    private String displayName;
     private String type;
     private String required;
     private String defaultValue;
@@ -34,10 +35,11 @@ public final class EndpointPath {
     private boolean enumType;
     private Set<String> enums;
 
-    public EndpointPath(String name, String type, String required, String defaultValue, String documentation,
+    public EndpointPath(String name, String displayName, String type, String required, String defaultValue, String documentation,
                         boolean deprecated, boolean secret, String group, String label,
                         boolean enumType, Set<String> enums) {
         this.name = name;
+        this.displayName = displayName;
         this.type = type;
         this.required = required;
         this.defaultValue = defaultValue;
@@ -54,6 +56,10 @@ public final class EndpointPath {
         return name;
     }
 
+    public String getDisplayName() {
+        return displayName;
+    }
+
     public String getType() {
         return type;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/78634db1/tooling/apt/src/test/java/org/apache/camel/tools/apt/EndpointOptionComparatorTest.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/test/java/org/apache/camel/tools/apt/EndpointOptionComparatorTest.java b/tooling/apt/src/test/java/org/apache/camel/tools/apt/EndpointOptionComparatorTest.java
index 0fea0a3..cb63506 100644
--- a/tooling/apt/src/test/java/org/apache/camel/tools/apt/EndpointOptionComparatorTest.java
+++ b/tooling/apt/src/test/java/org/apache/camel/tools/apt/EndpointOptionComparatorTest.java
@@ -39,10 +39,10 @@ public class EndpointOptionComparatorTest {
         String group3 = EndpointHelper.labelAsGroupName(label3, false, false);
         String group4 = EndpointHelper.labelAsGroupName(label4, false, false);
 
-        EndpointOption op1 = new EndpointOption("first", "string", "true", "", "", "blah", null, null, false, false, false, group1, label1, false, null);
-        EndpointOption op2 = new EndpointOption("synchronous", "string", "true", "", "", "blah", null, null, false, false, false, group2, label2, false, null);
-        EndpointOption op3 = new EndpointOption("second", "string", "true", "", "", "blah", null, null, false, false, false, group3, label3, false, null);
-        EndpointOption op4 = new EndpointOption("country", "string", "true", "", "", "blah", null, null, false, false, false, group4, label4, false, null);
+        EndpointOption op1 = new EndpointOption("first", "First","string", "true", "", "", "blah", null, null, false, false, false, group1, label1, false, null);
+        EndpointOption op2 = new EndpointOption("synchronous", "Synchronous","string", "true", "", "", "blah", null, null, false, false, false, group2, label2, false, null);
+        EndpointOption op3 = new EndpointOption("second", "Second","string", "true", "", "", "blah", null, null, false, false, false, group3, label3, false, null);
+        EndpointOption op4 = new EndpointOption("country", "Country","string", "true", "", "", "blah", null, null, false, false, false, group4, label4, false, null);
 
         List<EndpointOption> list = new ArrayList<EndpointOption>();
         list.add(op1);

http://git-wip-us.apache.org/repos/asf/camel/blob/78634db1/tooling/spi-annotations/src/main/java/org/apache/camel/spi/Metadata.java
----------------------------------------------------------------------
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/Metadata.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/Metadata.java
index 3aa9382..b2c77bd 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/Metadata.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/Metadata.java
@@ -33,6 +33,13 @@ import java.lang.annotation.Target;
 public @interface Metadata {
 
     /**
+     * A human display name of the parameter.
+     * <p/>
+     * This is used for documentation and tooling only.
+     */
+    String displayName() default "";
+
+    /**
      * To define one or more labels.
      * <p/>
      * Multiple labels can be defined as a comma separated value.

http://git-wip-us.apache.org/repos/asf/camel/blob/78634db1/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
----------------------------------------------------------------------
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
index dc9a544..f2ebdeda 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriParam.java
@@ -38,6 +38,13 @@ public @interface UriParam {
     String name() default "";
 
     /**
+     * A human display name of the parameter.
+     * <p/>
+     * This is used for documentation and tooling only.
+     */
+    String displayName() default "";
+
+    /**
      * The default value of the parameter.
      * <p/>
      * Note that this attribute is only for documentation purpose. The default value in use at runtime is the value the Java field was assigned.

http://git-wip-us.apache.org/repos/asf/camel/blob/78634db1/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
----------------------------------------------------------------------
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
index 23dac1f..2a3d014 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriPath.java
@@ -40,6 +40,13 @@ public @interface UriPath {
     String name() default "";
 
     /**
+     * A human display name of the parameter.
+     * <p/>
+     * This is used for documentation and tooling only.
+     */
+    String displayName() default "";
+
+    /**
      * The default value of the parameter.
      * <p/>
      * Note that this attribute is only for documentation purpose. The default value in use at runtime is the value the Java field was assigned.

Reply | Threaded
Open this post in threaded view
|

[2/4] camel git commit: CAMEL-10847: Component json schema - Include display name for options

davsclaus-2
CAMEL-10847: Component json schema - Include display name for options


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5c7613a1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5c7613a1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5c7613a1

Branch: refs/heads/master
Commit: 5c7613a1ad29f6a9e7aa09688d0171121c2942ee
Parents: 78634db
Author: Claus Ibsen <[hidden email]>
Authored: Thu Feb 16 19:55:05 2017 +0100
Committer: Claus Ibsen <[hidden email]>
Committed: Thu Feb 16 19:55:05 2017 +0100

----------------------------------------------------------------------
 .../tools/apt/SpringAnnotationProcessor.java    | 25 +-------------------
 .../tools/apt/helper/JsonSchemaHelper.java      | 10 ++++----
 .../apache/camel/tools/apt/helper/Strings.java  | 22 +++++++++++++++++
 3 files changed, 29 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5c7613a1/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessor.java
index f6def82..06a8620 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessor.java
@@ -124,7 +124,7 @@ public class SpringAnnotationProcessor {
             buffer.append("\n    \"title\": \"").append(eipModel.getTitle()).append("\",");
         } else {
             // fallback and use name as title
-            buffer.append("\n    \"title\": \"").append(asTitle(eipModel.getName())).append("\",");
+            buffer.append("\n    \"title\": \"").append(Strings.asTitle(eipModel.getName())).append("\",");
         }
         buffer.append("\n    \"description\": \"").append(safeNull(eipModel.getDescription())).append("\",");
         buffer.append("\n    \"javaType\": \"").append(eipModel.getJavaType()).append("\",");
@@ -495,29 +495,6 @@ public class SpringAnnotationProcessor {
         return defaultValue;
     }
 
-    /**
-     * Capitializes the name as a title
-     *
-     * @param name  the name
-     * @return as a title
-     */
-    private static String asTitle(String name) {
-        StringBuilder sb = new StringBuilder();
-        for (char c : name.toCharArray()) {
-            boolean upper = Character.isUpperCase(c);
-            boolean first = sb.length() == 0;
-            if (first) {
-                sb.append(Character.toUpperCase(c));
-            } else if (upper) {
-                sb.append(' ');
-                sb.append(c);
-            } else {
-                sb.append(Character.toLowerCase(c));
-            }
-        }
-        return sb.toString().trim();
-    }
-
     private static final class EipModel {
 
         private String name;

http://git-wip-us.apache.org/repos/asf/camel/blob/5c7613a1/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java
index b5c8264..caebe71 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java
@@ -51,11 +51,13 @@ public final class JsonSchemaHelper {
         sb.append(": { \"kind\": ");
         sb.append(Strings.doubleQuote(kind));
 
-        // we want display name early so its easier to spot
-        if (!Strings.isNullOrEmpty(displayName)) {
-            sb.append(", \"displayName\": ");
-            sb.append(Strings.doubleQuote(label));
+        // compute a display name if we don't have anything
+        if (Strings.isNullOrEmpty(displayName)) {
+            displayName = Strings.asTitle(name);
         }
+        // we want display name early so its easier to spot
+        sb.append(", \"displayName\": ");
+        sb.append(Strings.doubleQuote(displayName));
 
         // we want group early so its easier to spot
         if (!Strings.isNullOrEmpty(group)) {

http://git-wip-us.apache.org/repos/asf/camel/blob/5c7613a1/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/Strings.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/Strings.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/Strings.java
index 7037140..6c5d870 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/Strings.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/Strings.java
@@ -115,4 +115,26 @@ public final class Strings {
         return text;
     }
 
+    /**
+     * Capitalizes the name as a title
+     *
+     * @param name  the name
+     * @return as a title
+     */
+    public static String asTitle(String name) {
+        StringBuilder sb = new StringBuilder();
+        for (char c : name.toCharArray()) {
+            boolean upper = Character.isUpperCase(c);
+            boolean first = sb.length() == 0;
+            if (first) {
+                sb.append(Character.toUpperCase(c));
+            } else if (upper) {
+                sb.append(' ');
+                sb.append(c);
+            } else {
+                sb.append(Character.toLowerCase(c));
+            }
+        }
+        return sb.toString().trim();
+    }
 }

Reply | Threaded
Open this post in threaded view
|

[3/4] camel git commit: CAMEL-10847: Component json schema - Include display name for options

davsclaus-2
In reply to this post by davsclaus-2
CAMEL-10847: Component json schema - Include display name for options


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/357093bd
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/357093bd
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/357093bd

Branch: refs/heads/master
Commit: 357093bdf7b262cc7c75479cb3b389f30988b635
Parents: 5c7613a
Author: Claus Ibsen <[hidden email]>
Authored: Thu Feb 16 21:24:07 2017 +0100
Committer: Claus Ibsen <[hidden email]>
Committed: Thu Feb 16 21:24:07 2017 +0100

----------------------------------------------------------------------
 .../camel/component/xslt/XsltEndpoint.java      |  2 +-
 .../apache/camel/catalog/CamelCatalogTest.java  |  7 +++
 .../src/test/resources/org/foo/camel/dummy.json | 64 ++++++++++----------
 .../resources/org/foo/camel/dummyformat.json    |  8 +--
 ...ponentConfigurationAndDocumentationTest.java |  4 +-
 ...ponentConfigurationAndDocumentationTest.java |  4 +-
 ...ponentConfigurationAndDocumentationTest.java |  4 +-
 ...ponentConfigurationAndDocumentationTest.java | 10 +--
 ...ponentConfigurationAndDocumentationTest.java |  5 +-
 ...ponentConfigurationAndDocumentationTest.java |  4 +-
 ...ponentConfigurationAndDocumentationTest.java |  4 +-
 .../camel/itest/doc/EipDocumentationTest.java   |  4 +-
 ...ponentConfigurationAndDocumentationTest.java |  6 +-
 ...ponentConfigurationAndDocumentationTest.java |  4 +-
 ...ponentConfigurationAndDocumentationTest.java |  4 +-
 ...ponentConfigurationAndDocumentationTest.java |  6 +-
 ...ponentConfigurationAndDocumentationTest.java |  6 +-
 ...ponentConfigurationAndDocumentationTest.java |  4 +-
 ...nguageConfigurationAndDocumentationTest.java |  2 +-
 ...FormatConfigurationAndDocumentationTest.java |  2 +-
 ...ponentConfigurationAndDocumentationTest.java |  4 +-
 ...ponentConfigurationAndDocumentationTest.java |  6 +-
 ...ponentConfigurationAndDocumentationTest.java |  6 +-
 .../tools/apt/EndpointAnnotationProcessor.java  | 10 ++-
 .../maven/packaging/ReadmeComponentMojo.java    |  4 ++
 .../SpringBootAutoConfigurationMojo.java        |  4 ++
 .../packaging/model/ComponentOptionModel.java   |  9 +++
 .../packaging/model/DataFormatOptionModel.java  |  9 +++
 .../maven/packaging/model/EipOptionModel.java   |  9 +++
 .../packaging/model/EndpointOptionModel.java    |  9 +++
 .../packaging/model/LanguageOptionModel.java    |  9 +++
 31 files changed, 149 insertions(+), 84 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/camel-core/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
index 1ab1bd9..d861d1c 100644
--- a/camel-core/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
@@ -94,7 +94,7 @@ public class XsltEndpoint extends ProcessorEndpoint {
     private ErrorListener errorListener;
     @UriParam(label = "advanced")
     private URIResolver uriResolver;
-    @UriParam(defaultValue = "true")
+    @UriParam(defaultValue = "true", displayName = "Allow StAX")
     private boolean allowStAX = true;
     @UriParam
     private boolean deleteOutputFile;

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
index 58db8e3..694ee76 100644
--- a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
+++ b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
@@ -1086,6 +1086,7 @@ public class CamelCatalogTest {
         Map<String, String> row = JSonSchemaHelper.getRow(rows, "exchangeFormatter");
         assertNotNull(row);
         assertEquals("org.apache.camel.spi.ExchangeFormatter", row.get("javaType"));
+        assertEquals("Exchange Formatter", row.get("displayName"));
 
         // properties
         rows = JSonSchemaHelper.parseJsonSchema("properties", json, true);
@@ -1095,31 +1096,37 @@ public class CamelCatalogTest {
         assertEquals("INFO", row.get("defaultValue"));
         String enums = JSonSchemaHelper.getPropertyEnum(rows, "level");
         assertEquals("ERROR,WARN,INFO,DEBUG,TRACE,OFF", enums);
+        assertEquals("Level", row.get("displayName"));
 
         row = JSonSchemaHelper.getRow(rows, "amount");
         assertNotNull(row);
         assertEquals("1", row.get("defaultValue"));
         assertEquals("Number of drinks in the order", row.get("description"));
+        assertEquals("Amount", row.get("displayName"));
 
         row = JSonSchemaHelper.getRow(rows, "maxChars");
         assertNotNull(row);
         assertEquals("false", row.get("deprecated"));
         assertEquals("10000", row.get("defaultValue"));
+        assertEquals("Max Chars", row.get("displayName"));
 
         row = JSonSchemaHelper.getRow(rows, "repeatCount");
         assertNotNull(row);
         assertEquals("long", row.get("javaType"));
         assertEquals("0", row.get("defaultValue"));
+        assertEquals("Repeat Count", row.get("displayName"));
 
         row = JSonSchemaHelper.getRow(rows, "fontSize");
         assertNotNull(row);
         assertEquals("false", row.get("deprecated"));
         assertEquals("14", row.get("defaultValue"));
+        assertEquals("Font Size", row.get("displayName"));
 
         row = JSonSchemaHelper.getRow(rows, "kerberosRenewJitter");
         assertNotNull(row);
         assertEquals("java.lang.Double", row.get("javaType"));
         assertEquals("0.05", row.get("defaultValue"));
+        assertEquals("Kerberos Renew Jitter", row.get("displayName"));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/platforms/catalog/src/test/resources/org/foo/camel/dummy.json
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/test/resources/org/foo/camel/dummy.json b/platforms/catalog/src/test/resources/org/foo/camel/dummy.json
index 45dfa15..1e2cdb9 100644
--- a/platforms/catalog/src/test/resources/org/foo/camel/dummy.json
+++ b/platforms/catalog/src/test/resources/org/foo/camel/dummy.json
@@ -14,40 +14,40 @@
     "version": "1.0"
   },
   "componentProperties": {
-    "exchangeFormatter": { "kind": "property", "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "description": "Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified we default to DefaultExchangeFormatter." }
+    "exchangeFormatter": { "kind": "property", "displayName": "Exchange Formatter", "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "description": "Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified we default to DefaultExchangeFormatter." }
   },
   "properties": {
-    "loggerName": { "kind": "path", "group": "producer", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "description": "The logger name to use" },
-    "amount": { "kind": "parameter", "group": "producer", "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": 1, "description": "Number of drinks in the order" },
-    "groupActiveOnly": { "kind": "parameter", "group": "producer", "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "defaultValue": true, "description": "If true will hide stats when no new messages have been received for a time interval if false show stats regardless of message traffic." },
-    "groupDelay": { "kind": "parameter", "group": "producer", "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "description": "Set the initial delay for stats (in millis)" },
-    "groupInterval": { "kind": "parameter", "group": "producer", "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "description": "If specified will group message stats by this time interval (in millis)" },
-    "groupSize": { "kind": "parameter", "group": "producer", "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "description": "An integer that specifies a group size for throughput logging." },
-    "level": { "kind": "parameter", "group": "producer", "type": "string", "javaType": "java.lang.String", "enum": [ "ERROR", "WARN", "INFO", "DEBUG", "TRACE", "OFF" ], "deprecated": false, "defaultValue": "INFO", "description": "Logging level to use. The default value is INFO." },
-    "marker": { "kind": "parameter", "group": "producer", "type": "string", "javaType": "java.lang.String", "deprecated": false, "description": "An optional Marker name to use." },
-    "exchangePattern": { "kind": "parameter", "group": "advanced", "label": "advanced", "type": "string", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "RobustInOnly", "InOut", "InOptionalOut", "OutOnly", "RobustOutOnly", "OutIn", "OutOptionalIn" ], "deprecated": false, "defaultValue": "InOnly", "description": "Sets the default exchange pattern when creating an exchange." },
-    "synchronous": { "kind": "parameter", "group": "advanced", "label": "advanced", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported)." },
-    "kerberosRenewJitter": { "kind": "parameter", "group": "security", "label": "common,security", "type": "number", "javaType": "java.lang.Double", "deprecated": false, "secret": false, "defaultValue": 0.05, "description": "Percentage of random jitter added to the renewal time." },
-    "maxChars": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "integer", "javaType": "int", "deprecated": false, "defaultValue": 10000, "description": "Limits the number of characters logged per line." },
-    "multiline": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "If enabled then each information is outputted on a newline." },
-    "repeatCount": { "kind": "parameter", "group": "consumer", "type": "integer", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1 the timer will only fire once. If you set it to 5 it will only fire five times. A value of zero or negative means fire forever." },
-    "showAll": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Quick option for turning all options on. (multiline maxChars has to be manually set if to be used)" },
-    "showBody": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": true, "description": "Show the message body." },
-    "showBodyType": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": true, "description": "Show the body Java type." },
-    "showCaughtException": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "f the exchange has a caught exception show the exception message (no stack trace). A caught exception is stored as a property on the exchange (using the key link org.apache.camel.ExchangeEXCEPTION_CAUGHT and for instance a doCatch can catch exceptions." },
-    "showException": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "If the exchange has an exception show the exception message (no stacktrace)" },
-    "showExchangeId": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Show the unique exchange ID." },
-    "showExchangePattern": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": true, "description": "Shows the Message Exchange Pattern (or MEP for short)." },
-    "showFiles": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "If enabled Camel will output files" },
-    "showFuture": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "If enabled Camel will on Future objects wait for it to complete to obtain the payload to be logged." },
-    "showHeaders": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Show the message headers." },
-    "showOut": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "If the exchange has an out message show the out message." },
-    "showProperties": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Show the exchange properties." },
-    "showStackTrace": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Show the stack trace if an exchange has an exception. Only effective if one of showAll showException or showCaughtException are enabled." },
-    "showStreams": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Whether Camel should show stream bodies or not (eg such as java.io.InputStream). Beware if you enable this option then you may not be able later to access the message body as the stream have already been read by this logger. To remedy this you will have to use Stream Caching." },
-    "skipBodyLineSeparator": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": true, "description": "Whether to skip line separators when logging the message body. This allows to log the message body in one line setting this option to false will preserve any line separators from the body which then will log the body as is." },
-    "fontSize": { "kind": "parameter", "group": "producer", "type": "number", "javaType": "float", "deprecated": false, "secret": false, "defaultValue": 14, "description": "Font size in pixels" },
-    "style": { "kind": "parameter", "group": "formatting", "label": "formatting", "type": "string", "javaType": "org.apache.camel.processor.DefaultExchangeFormatter.OutputStyle", "enum": [ "Default", "Tab", "Fixed" ], "deprecated": false, "defaultValue": "Default", "description": "Sets the outputs style to use." }
+    "loggerName": { "kind": "path", "displayName": "Logger Name", "group": "producer", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "description": "The logger name to use" },
+    "amount": { "kind": "parameter", "displayName": "Amount", "group": "producer", "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": 1, "description": "Number of drinks in the order" },
+    "groupActiveOnly": { "kind": "parameter", "displayName": "Group Active Only", "group": "producer", "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "defaultValue": true, "description": "If true will hide stats when no new messages have been received for a time interval if false show stats regardless of message traffic." },
+    "groupDelay": { "kind": "parameter", "displayName": "Group Delay", "group": "producer", "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "description": "Set the initial delay for stats (in millis)" },
+    "groupInterval": { "kind": "parameter", "displayName": "Group Interval", "group": "producer", "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "description": "If specified will group message stats by this time interval (in millis)" },
+    "groupSize": { "kind": "parameter", "displayName": "Group Size", "group": "producer", "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "description": "An integer that specifies a group size for throughput logging." },
+    "level": { "kind": "parameter", "displayName": "Level", "group": "producer", "type": "string", "javaType": "java.lang.String", "enum": [ "ERROR", "WARN", "INFO", "DEBUG", "TRACE", "OFF" ], "deprecated": false, "defaultValue": "INFO", "description": "Logging level to use. The default value is INFO." },
+    "marker": { "kind": "parameter", "displayName": "Marker", "group": "producer", "type": "string", "javaType": "java.lang.String", "deprecated": false, "description": "An optional Marker name to use." },
+    "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "advanced", "label": "advanced", "type": "string", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "RobustInOnly", "InOut", "InOptionalOut", "OutOnly", "RobustOutOnly", "OutIn", "OutOptionalIn" ], "deprecated": false, "defaultValue": "InOnly", "description": "Sets the default exchange pattern when creating an exchange." },
+    "synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported)." },
+    "kerberosRenewJitter": { "kind": "parameter", "displayName": "Kerberos Renew Jitter", "group": "security", "label": "common,security", "type": "number", "javaType": "java.lang.Double", "deprecated": false, "secret": false, "defaultValue": 0.05, "description": "Percentage of random jitter added to the renewal time." },
+    "maxChars": { "kind": "parameter", "displayName": "Max Chars", "group": "formatting", "label": "formatting", "type": "integer", "javaType": "int", "deprecated": false, "defaultValue": 10000, "description": "Limits the number of characters logged per line." },
+    "multiline": { "kind": "parameter", "displayName": "Multiline", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "If enabled then each information is outputted on a newline." },
+    "repeatCount": { "kind": "parameter", "displayName": "Repeat Count", "group": "consumer", "type": "integer", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1 the timer will only fire once. If you set it to 5 it will only fire five times. A value of zero or negative means fire forever." },
+    "showAll": { "kind": "parameter", "displayName": "Show All", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Quick option for turning all options on. (multiline maxChars has to be manually set if to be used)" },
+    "showBody": { "kind": "parameter", "displayName": "Show Body", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": true, "description": "Show the message body." },
+    "showBodyType": { "kind": "parameter", "displayName": "Show Body Type", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": true, "description": "Show the body Java type." },
+    "showCaughtException": { "kind": "parameter", "displayName": "Show Caught Exception", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "f the exchange has a caught exception show the exception message (no stack trace). A caught exception is stored as a property on the exchange (using the key link org.apache.camel.ExchangeEXCEPTION_CAUGHT and for instance a doCatch can catch exceptions." },
+    "showException": { "kind": "parameter", "displayName": "Show Exception", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "If the exchange has an exception show the exception message (no stacktrace)" },
+    "showExchangeId": { "kind": "parameter", "displayName": "Show Exchange Id", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Show the unique exchange ID." },
+    "showExchangePattern": { "kind": "parameter", "displayName": "Show Exchange Pattern", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": true, "description": "Shows the Message Exchange Pattern (or MEP for short)." },
+    "showFiles": { "kind": "parameter", "displayName": "Show Files", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "If enabled Camel will output files" },
+    "showFuture": { "kind": "parameter", "displayName": "Show Future", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "If enabled Camel will on Future objects wait for it to complete to obtain the payload to be logged." },
+    "showHeaders": { "kind": "parameter", "displayName": "Show Headers", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Show the message headers." },
+    "showOut": { "kind": "parameter", "displayName": "Show Out", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "If the exchange has an out message show the out message." },
+    "showProperties": { "kind": "parameter", "displayName": "Show Properties", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Show the exchange properties." },
+    "showStackTrace": { "kind": "parameter", "displayName": "Show Stack Trace", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Show the stack trace if an exchange has an exception. Only effective if one of showAll showException or showCaughtException are enabled." },
+    "showStreams": { "kind": "parameter", "displayName": "Show Streams", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": false, "description": "Whether Camel should show stream bodies or not (eg such as java.io.InputStream). Beware if you enable this option then you may not be able later to access the message body as the stream have already been read by this logger. To remedy this you will have to use Stream Caching." },
+    "skipBodyLineSeparator": { "kind": "parameter", "displayName": "Show Body Line Separator", "group": "formatting", "label": "formatting", "type": "boolean", "javaType": "boolean", "deprecated": false, "defaultValue": true, "description": "Whether to skip line separators when logging the message body. This allows to log the message body in one line setting this option to false will preserve any line separators from the body which then will log the body as is." },
+    "fontSize": { "kind": "parameter", "displayName": "Font Size", "group": "producer", "type": "number", "javaType": "float", "deprecated": false, "secret": false, "defaultValue": 14, "description": "Font size in pixels" },
+    "style": { "kind": "parameter", "displayName": "Style", "group": "formatting", "label": "formatting", "type": "string", "javaType": "org.apache.camel.processor.DefaultExchangeFormatter.OutputStyle", "enum": [ "Default", "Tab", "Fixed" ], "deprecated": false, "defaultValue": "Default", "description": "Sets the outputs style to use." }
   }
 }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/platforms/catalog/src/test/resources/org/foo/camel/dummyformat.json
----------------------------------------------------------------------
diff --git a/platforms/catalog/src/test/resources/org/foo/camel/dummyformat.json b/platforms/catalog/src/test/resources/org/foo/camel/dummyformat.json
index b297f74..d563812 100644
--- a/platforms/catalog/src/test/resources/org/foo/camel/dummyformat.json
+++ b/platforms/catalog/src/test/resources/org/foo/camel/dummyformat.json
@@ -12,10 +12,10 @@
     "version": "1.0"
   },
   "properties": {
-    "lineLength": { "kind": "attribute", "required": "false", "type": "integer", "javaType": "java.lang.Integer", "deprecated": "false", "defaultValue": "76", "description": "To specific a maximum line length for the encoded data. By default 76 is used." },
-    "lineSeparator": { "kind": "attribute", "required": "false", "type": "string", "javaType": "java.lang.String", "deprecated": "false", "defaultValue": "\r\n", "description": "The line separators to use. By default \r\n is used." },
-    "urlSafe": { "kind": "attribute", "required": "false", "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": "false", "defaultValue": "false", "description": "Instead of emitting '' and '/' we emit '-' and '_' respectively. urlSafe is only applied to encode operations. Decoding seamlessly handles both modes. Is by default false." },
-    "id": { "kind": "attribute", "required": "false", "type": "string", "javaType": "java.lang.String", "deprecated": "false", "description": "Sets the value of the id property." }
+    "lineLength": { "kind": "attribute", "displayName": "Line Length", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "defaultValue": "76", "description": "To specific a maximum line length for the encoded data. By default 76 is used." },
+    "lineSeparator": { "kind": "attribute", "displayName": "Line Separator", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "defaultValue": "\r\n", "description": "The line separators to use. By default \r\n is used." },
+    "urlSafe": { "kind": "attribute", "displayName": "Url Safe", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "defaultValue": false, "description": "Instead of emitting '' and '/' we emit '-' and '_' respectively. urlSafe is only applied to encode operations. Decoding seamlessly handles both modes. Is by default false." },
+    "id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "description": "Sets the value of the id property." }
   }
 }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/BeanComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/BeanComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/BeanComponentConfigurationAndDocumentationTest.java
index e8c5cfb..fa6fb12 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/BeanComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/BeanComponentConfigurationAndDocumentationTest.java
@@ -40,8 +40,8 @@ public class BeanComponentConfigurationAndDocumentationTest extends CamelTestSup
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"method\": { \"kind\": \"parameter\", \"group\": \"producer\", \"type\": \"string\""));
-        assertTrue(json.contains("\"cache\": { \"kind\": \"parameter\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
+        assertTrue(json.contains("\"method\": { \"kind\": \"parameter\", \"displayName\": \"Method\", \"group\": \"producer\", \"type\": \"string\""));
+        assertTrue(json.contains("\"cache\": { \"kind\": \"parameter\", \"displayName\": \"Cache\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/BrowseComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/BrowseComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/BrowseComponentConfigurationAndDocumentationTest.java
index af4caaf..d4d3893 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/BrowseComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/BrowseComponentConfigurationAndDocumentationTest.java
@@ -40,8 +40,8 @@ public class BrowseComponentConfigurationAndDocumentationTest extends CamelTestS
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"group\": \"common\", \"required\": true, \"type\": \"string\""));
-        assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"common\", \"required\": true, \"type\": \"string\""));
+        assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"displayName\": \"Synchronous\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/ControlBusComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/ControlBusComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/ControlBusComponentConfigurationAndDocumentationTest.java
index f876b61..070a376 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/ControlBusComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/ControlBusComponentConfigurationAndDocumentationTest.java
@@ -41,8 +41,8 @@ public class ControlBusComponentConfigurationAndDocumentationTest extends CamelT
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"action\": { \"kind\": \"parameter\", \"group\": \"producer\", \"type\": \"string\""));
-        assertTrue(json.contains("\"async\": { \"kind\": \"parameter\", \"group\": \"producer\", \"type\": \"boolean\""));
+        assertTrue(json.contains("\"action\": { \"kind\": \"parameter\", \"displayName\": \"Action\", \"group\": \"producer\", \"type\": \"string\""));
+        assertTrue(json.contains("\"async\": { \"kind\": \"parameter\", \"displayName\": \"Async\", \"group\": \"producer\", \"type\": \"boolean\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DataFormatComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DataFormatComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DataFormatComponentConfigurationAndDocumentationTest.java
index 483d7e3..ba96182 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DataFormatComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DataFormatComponentConfigurationAndDocumentationTest.java
@@ -46,10 +46,10 @@ public class DataFormatComponentConfigurationAndDocumentationTest extends CamelT
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"group\": \"producer\", \"required\": true, \"type\": \"string\", \"javaType\": \"java.lang.String\","
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"producer\", \"required\": true, \"type\": \"string\", \"javaType\": \"java.lang.String\","
             + " \"deprecated\": false, \"secret\": false, \"description\": \"Name of data format\" }"));
-        assertTrue(json.contains("\"operation\": { \"kind\": \"path\", \"group\": \"producer\", \"required\": true, \"type\": \"string\""));
-        assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
+        assertTrue(json.contains("\"operation\": { \"kind\": \"path\", \"displayName\": \"Operation\", \"group\": \"producer\", \"required\": true, \"type\": \"string\""));
+        assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"displayName\": \"Synchronous\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
     }
 
     @Test
@@ -61,7 +61,7 @@ public class DataFormatComponentConfigurationAndDocumentationTest extends CamelT
         assertTrue(json.contains("\"name\": \"flatpack"));
 
         // the default value is a bit tricky as its ", which is written escaped as \"
-        assertTrue(json.contains("\"textQualifier\": { \"kind\": \"attribute\", \"required\": false, \"type\": \"string\""
+        assertTrue(json.contains("\"textQualifier\": { \"kind\": \"attribute\", \"displayName\": \"Text Qualifier\", \"required\": false, \"type\": \"string\""
             + ", \"javaType\": \"java.lang.String\", \"deprecated\": false, \"secret\": false, \"defaultValue\": \"\\\"\""));
 
         List<Map<String, String>> rows = JsonSchemaHelper.parseJsonSchema("properties", json, true);
@@ -95,7 +95,7 @@ public class DataFormatComponentConfigurationAndDocumentationTest extends CamelT
         assertTrue(json.contains("\"name\": \"univocity-tsv"));
 
         // the default value is a bit tricky as its \, which is written escaped as \\
-        assertTrue(json.contains("\"escapeChar\": { \"kind\": \"attribute\", \"required\": false, \"type\": \"string\", \"javaType\": \"java.lang.String\","
+        assertTrue(json.contains("\"escapeChar\": { \"kind\": \"attribute\", \"displayName\": \"Escape Char\", \"required\": false, \"type\": \"string\", \"javaType\": \"java.lang.String\","
             + " \"deprecated\": false, \"secret\": false, \"defaultValue\": \"\\\\\", \"description\": \"The escape character.\""));
 
         List<Map<String, String>> rows = JsonSchemaHelper.parseJsonSchema("properties", json, true);

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DataSetComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DataSetComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DataSetComponentConfigurationAndDocumentationTest.java
index 6e831d6..2794cdc 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DataSetComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DataSetComponentConfigurationAndDocumentationTest.java
@@ -45,9 +45,8 @@ public class DataSetComponentConfigurationAndDocumentationTest extends CamelTest
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"group\": \"common\", \"required\": true, \"type\""));
-        assertTrue(json.contains("\"kind\": \"parameter\", \"group\": \"consumer\", \"label\": \"consumer\", \"type\": \"integer\""));
-        assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer"));
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"common\", \"required\": true, \"type\""));
+        assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"displayName\": \"Retain First\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer"));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectComponentConfigurationAndDocumentationTest.java
index 34ba179..80e15a6 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectComponentConfigurationAndDocumentationTest.java
@@ -42,8 +42,8 @@ public class DirectComponentConfigurationAndDocumentationTest extends CamelTestS
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"group\": \"common\", \"required\": true, \"type\": \"string\""));
-        assertTrue(json.contains("\"timeout\": { \"kind\": \"parameter\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer\""));
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"common\", \"required\": true, \"type\": \"string\""));
+        assertTrue(json.contains("\"timeout\": { \"kind\": \"parameter\", \"displayName\": \"Timeout\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer\""));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectVmComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectVmComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectVmComponentConfigurationAndDocumentationTest.java
index 32f5750..f21b8f1 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectVmComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/DirectVmComponentConfigurationAndDocumentationTest.java
@@ -40,8 +40,8 @@ public class DirectVmComponentConfigurationAndDocumentationTest extends CamelTes
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"group\": \"common\", \"required\": true, \"type\": \"string\""));
-        assertTrue(json.contains("\"timeout\": { \"kind\": \"parameter\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer\""));
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"common\", \"required\": true, \"type\": \"string\""));
+        assertTrue(json.contains("\"timeout\": { \"kind\": \"parameter\", \"displayName\": \"Timeout\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/EipDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/EipDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/EipDocumentationTest.java
index 2a8cef1..3beb743 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/EipDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/EipDocumentationTest.java
@@ -51,7 +51,7 @@ public class EipDocumentationTest extends CamelTestSupport {
         // there should be javadoc included
         assertTrue(json.contains("If enabled then processing each splitted messages occurs concurrently."));
         // and it support outputs
-        assertTrue(json.contains("\"outputs\": { \"kind\": \"element\", \"required\": true, \"type\": \"array\", \"javaType\""));
+        assertTrue(json.contains("\"outputs\": { \"kind\": \"element\", \"displayName\": \"Outputs\", \"required\": true, \"type\": \"array\", \"javaType\""));
     }
 
     @Test
@@ -73,7 +73,7 @@ public class EipDocumentationTest extends CamelTestSupport {
         assertNotNull("Should have found json for failover", json);
 
         assertTrue(json.contains("\"name\": \"failover\""));
-        assertTrue(json.contains("\"exception\": { \"kind\": \"element\", \"required\": false, \"type\": \"array\""
+        assertTrue(json.contains("\"exception\": { \"kind\": \"element\", \"displayName\": \"Exception\", \"required\": false, \"type\": \"array\""
             + ", \"javaType\": \"java.util.List<java.lang.String>\", \"deprecated\": false"));
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FileComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FileComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FileComponentConfigurationAndDocumentationTest.java
index d1c8548..7eebdbc 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FileComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FileComponentConfigurationAndDocumentationTest.java
@@ -40,9 +40,9 @@ public class FileComponentConfigurationAndDocumentationTest extends CamelTestSup
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"directoryName\": { \"kind\": \"path\", \"group\": \"common\", \"required\": true"));
-        assertTrue(json.contains("\"autoCreate\": { \"kind\": \"parameter\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
-        assertTrue(json.contains("\"readLockMinAge\": { \"kind\": \"parameter\", \"group\": \"lock\", \"label\": \"consumer,lock\""));
+        assertTrue(json.contains("\"directoryName\": { \"kind\": \"path\", \"displayName\": \"Directory Name\", \"group\": \"common\", \"required\": true"));
+        assertTrue(json.contains("\"autoCreate\": { \"kind\": \"parameter\", \"displayName\": \"Auto Create\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
+        assertTrue(json.contains("\"readLockMinAge\": { \"kind\": \"parameter\", \"displayName\": \"Read Lock Min Age\", \"group\": \"lock\", \"label\": \"consumer,lock\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FtpComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FtpComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FtpComponentConfigurationAndDocumentationTest.java
index 3ef70c3..a316e3b 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FtpComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/FtpComponentConfigurationAndDocumentationTest.java
@@ -42,8 +42,8 @@ public class FtpComponentConfigurationAndDocumentationTest extends CamelTestSupp
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"minDepth\": { \"kind\": \"parameter\", \"group\": \"filter\", \"label\": \"consumer,filter\", \"type\": \"integer\", \"javaType\": \"int\""));
-        assertTrue(json.contains("\"username\": { \"kind\": \"parameter\", \"group\": \"security\", \"label\": \"security\", \"type\": \"string\""));
+        assertTrue(json.contains("\"minDepth\": { \"kind\": \"parameter\", \"displayName\": \"Min Depth\", \"group\": \"filter\", \"label\": \"consumer,filter\", \"type\": \"integer\", \"javaType\": \"int\""));
+        assertTrue(json.contains("\"username\": { \"kind\": \"parameter\", \"displayName\": \"Username\", \"group\": \"security\", \"label\": \"security\", \"type\": \"string\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LanguageComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LanguageComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LanguageComponentConfigurationAndDocumentationTest.java
index 5e6c3e5..14af531 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LanguageComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LanguageComponentConfigurationAndDocumentationTest.java
@@ -40,8 +40,8 @@ public class LanguageComponentConfigurationAndDocumentationTest extends CamelTes
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"languageName\": { \"kind\": \"path\", \"group\": \"producer\", \"required\": true"));
-        assertTrue(json.contains("\"script\": { \"kind\": \"parameter\", \"group\": \"producer\", \"type\": \"string\""));
+        assertTrue(json.contains("\"languageName\": { \"kind\": \"path\", \"displayName\": \"Language Name\", \"group\": \"producer\", \"required\": true"));
+        assertTrue(json.contains("\"script\": { \"kind\": \"parameter\", \"displayName\": \"Script\", \"group\": \"producer\", \"type\": \"string\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LogComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LogComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LogComponentConfigurationAndDocumentationTest.java
index 2758d70..a661308 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LogComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/LogComponentConfigurationAndDocumentationTest.java
@@ -40,9 +40,9 @@ public class LogComponentConfigurationAndDocumentationTest extends CamelTestSupp
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"loggerName\": { \"kind\": \"path\", \"group\": \"producer\", \"required\": true"));
-        assertTrue(json.contains("\"level\": { \"kind\": \"parameter\", \"group\": \"producer\", \"type\": \"string\""));
-        assertTrue(json.contains("\"showBody\": { \"kind\": \"parameter\", \"group\": \"formatting\", \"label\": \"formatting\""));
+        assertTrue(json.contains("\"loggerName\": { \"kind\": \"path\", \"displayName\": \"Logger Name\", \"group\": \"producer\", \"required\": true"));
+        assertTrue(json.contains("\"level\": { \"kind\": \"parameter\", \"displayName\": \"Level\", \"group\": \"producer\", \"type\": \"string\""));
+        assertTrue(json.contains("\"showBody\": { \"kind\": \"parameter\", \"displayName\": \"Show Body\", \"group\": \"formatting\", \"label\": \"formatting\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/MockComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/MockComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/MockComponentConfigurationAndDocumentationTest.java
index 596c3c8..bdcef47 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/MockComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/MockComponentConfigurationAndDocumentationTest.java
@@ -40,9 +40,9 @@ public class MockComponentConfigurationAndDocumentationTest extends CamelTestSup
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"group\": \"producer\", \"required\": true"));
-        assertTrue(json.contains("\"expectedCount\": { \"kind\": \"parameter\", \"group\": \"producer\", \"label\": \"producer\""));
-        assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"group\": \"producer\", \"label\": \"producer\""));
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"producer\", \"required\": true"));
+        assertTrue(json.contains("\"expectedCount\": { \"kind\": \"parameter\", \"displayName\": \"Expected Count\", \"group\": \"producer\", \"label\": \"producer\""));
+        assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"displayName\": \"Retain First\", \"group\": \"producer\", \"label\": \"producer\""));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SedaComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SedaComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SedaComponentConfigurationAndDocumentationTest.java
index aa061a8..4906449 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SedaComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SedaComponentConfigurationAndDocumentationTest.java
@@ -40,8 +40,8 @@ public class SedaComponentConfigurationAndDocumentationTest extends CamelTestSup
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"concurrentConsumers\": { \"kind\": \"parameter\", \"group\": \"consumer\", \"label\": \"consumer\""));
-        assertTrue(json.contains("\"timeout\": { \"kind\": \"parameter\", \"group\": \"producer\", \"label\": \"producer\""));
+        assertTrue(json.contains("\"concurrentConsumers\": { \"kind\": \"parameter\", \"displayName\": \"Concurrent Consumers\", \"group\": \"consumer\", \"label\": \"consumer\""));
+        assertTrue(json.contains("\"timeout\": { \"kind\": \"parameter\", \"displayName\": \"Timeout\", \"group\": \"producer\", \"label\": \"producer\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SimpleLanguageConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SimpleLanguageConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SimpleLanguageConfigurationAndDocumentationTest.java
index bde859a..bd8e839 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SimpleLanguageConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/SimpleLanguageConfigurationAndDocumentationTest.java
@@ -37,7 +37,7 @@ public class SimpleLanguageConfigurationAndDocumentationTest extends CamelTestSu
 
         assertTrue(json.contains("\"name\": \"simple\""));
         assertTrue(json.contains("\"modelName\": \"simple\""));
-        assertTrue(json.contains("\"resultType\": { \"kind\": \"attribute\", \"required\": false, \"type\": \"string\", \"javaType\": \"java.lang.String\", \"deprecated\": false"));
+        assertTrue(json.contains("\"resultType\": { \"kind\": \"attribute\", \"displayName\": \"Result Type\", \"required\": false, \"type\": \"string\", \"javaType\": \"java.lang.String\", \"deprecated\": false"));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/StringDataFormatConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/StringDataFormatConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/StringDataFormatConfigurationAndDocumentationTest.java
index 8a735fa..0930b0f 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/StringDataFormatConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/StringDataFormatConfigurationAndDocumentationTest.java
@@ -37,7 +37,7 @@ public class StringDataFormatConfigurationAndDocumentationTest extends CamelTest
 
         assertTrue(json.contains("\"name\": \"string\""));
         assertTrue(json.contains("\"modelName\": \"string\""));
-        assertTrue(json.contains("\"charset\": { \"kind\": \"attribute\", \"required\": false, \"type\": \"string\", \"javaType\": \"java.lang.String\", \"deprecated\": false"));
+        assertTrue(json.contains("\"charset\": { \"kind\": \"attribute\", \"displayName\": \"Charset\", \"required\": false, \"type\": \"string\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TestComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TestComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TestComponentConfigurationAndDocumentationTest.java
index 3281e49..d7308db 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TestComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TestComponentConfigurationAndDocumentationTest.java
@@ -40,8 +40,8 @@ public class TestComponentConfigurationAndDocumentationTest extends CamelTestSup
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"group\": \"producer\", \"required\": true"));
-        assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"group\": \"producer\", \"label\": \"producer\""));
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"producer\", \"required\": true"));
+        assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"displayName\": \"Retain First\", \"group\": \"producer\", \"label\": \"producer\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TimerComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TimerComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TimerComponentConfigurationAndDocumentationTest.java
index e2bc4a3..6b9f55b 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TimerComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/TimerComponentConfigurationAndDocumentationTest.java
@@ -40,9 +40,9 @@ public class TimerComponentConfigurationAndDocumentationTest extends CamelTestSu
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"timerName\": { \"kind\": \"path\", \"group\": \"consumer\", \"required\": true"));
-        assertTrue(json.contains("\"delay\": { \"kind\": \"parameter\", \"group\": \"consumer\", \"type\": \"integer\""));
-        assertTrue(json.contains("\"timer\": { \"kind\": \"parameter\", \"group\": \"advanced\", \"label\": \"advanced\""));
+        assertTrue(json.contains("\"timerName\": { \"kind\": \"path\", \"displayName\": \"Timer Name\", \"group\": \"consumer\", \"required\": true"));
+        assertTrue(json.contains("\"delay\": { \"kind\": \"parameter\", \"displayName\": \"Delay\", \"group\": \"consumer\", \"type\": \"integer\""));
+        assertTrue(json.contains("\"timer\": { \"kind\": \"parameter\", \"displayName\": \"Timer\", \"group\": \"advanced\", \"label\": \"advanced\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/XsltComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/XsltComponentConfigurationAndDocumentationTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/XsltComponentConfigurationAndDocumentationTest.java
index 26bb7f9..2fb3fa3 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/XsltComponentConfigurationAndDocumentationTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/doc/XsltComponentConfigurationAndDocumentationTest.java
@@ -40,9 +40,9 @@ public class XsltComponentConfigurationAndDocumentationTest extends CamelTestSup
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"resourceUri\": { \"kind\": \"path\", \"group\": \"producer\", \"required\": true"));
-        assertTrue(json.contains("\"allowStAX\": { \"kind\": \"parameter\", \"group\": \"producer\", \"type\": \"boolean\""));
-        assertTrue(json.contains("\"transformerFactoryClass\": { \"kind\": \"parameter\", \"group\": \"advanced\", \"label\": \"advanced\""));
+        assertTrue(json.contains("\"resourceUri\": { \"kind\": \"path\", \"displayName\": \"Resource Uri\", \"group\": \"producer\", \"required\": true"));
+        assertTrue(json.contains("\"allowStAX\": { \"kind\": \"parameter\", \"displayName\": \"Allow StAX\", \"group\": \"producer\", \"type\": \"boolean\""));
+        assertTrue(json.contains("\"transformerFactoryClass\": { \"kind\": \"parameter\", \"displayName\": \"Transformer Factory Class\", \"group\": \"advanced\", \"label\": \"advanced\""));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index 72a25cb..430cf68 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -570,7 +570,10 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                     if (Strings.isNullOrEmpty(label) && metadata != null) {
                         label = metadata.label();
                     }
-                    String displayName = metadata != null ? metadata.displayName() : null;
+                    String displayName = path.displayName();
+                    if (Strings.isNullOrEmpty(displayName)) {
+                        displayName = metadata != null ? metadata.displayName() : null;
+                    }
 
                     TypeMirror fieldType = fieldElement.asType();
                     String fieldTypeName = fieldType.toString();
@@ -646,7 +649,10 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                     if (Strings.isNullOrEmpty(label) && metadata != null) {
                         label = metadata.label();
                     }
-                    String displayName = metadata != null ? metadata.displayName() : null;
+                    String displayName = param.displayName();
+                    if (Strings.isNullOrEmpty(displayName)) {
+                        displayName = metadata != null ? metadata.displayName() : null;
+                    }
 
                     // if the field type is a nested parameter then iterate through its fields
                     TypeMirror fieldType = fieldElement.asType();

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java
index 496a591..f781e73 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java
@@ -633,6 +633,7 @@ public class ReadmeComponentMojo extends AbstractMojo {
         for (Map<String, String> row : rows) {
             ComponentOptionModel option = new ComponentOptionModel();
             option.setName(getSafeValue("name", row));
+            option.setDisplayName(getSafeValue("displayName", row));
             option.setKind(getSafeValue("kind", row));
             option.setGroup(getSafeValue("group", row));
             option.setRequired(getSafeValue("required", row));
@@ -655,6 +656,7 @@ public class ReadmeComponentMojo extends AbstractMojo {
         for (Map<String, String> row : rows) {
             EndpointOptionModel option = new EndpointOptionModel();
             option.setName(getSafeValue("name", row));
+            option.setDisplayName(getSafeValue("displayName", row));
             option.setKind(getSafeValue("kind", row));
             option.setGroup(getSafeValue("group", row));
             option.setRequired(getSafeValue("required", row));
@@ -698,6 +700,7 @@ public class ReadmeComponentMojo extends AbstractMojo {
         for (Map<String, String> row : rows) {
             DataFormatOptionModel option = new DataFormatOptionModel();
             option.setName(getSafeValue("name", row));
+            option.setDisplayName(getSafeValue("displayName", row));
             option.setKind(getSafeValue("kind", row));
             option.setType(getSafeValue("type", row));
             option.setJavaType(getSafeValue("javaType", row));
@@ -744,6 +747,7 @@ public class ReadmeComponentMojo extends AbstractMojo {
         for (Map<String, String> row : rows) {
             LanguageOptionModel option = new LanguageOptionModel();
             option.setName(getSafeValue("name", row));
+            option.setDisplayName(getSafeValue("displayName", row));
             option.setKind(getSafeValue("kind", row));
             option.setType(getSafeValue("type", row));
             option.setJavaType(getSafeValue("javaType", row));

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java
----------------------------------------------------------------------
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 b8e6ced..7094d9e 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
@@ -1233,6 +1233,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo {
         for (Map<String, String> row : rows) {
             ComponentOptionModel option = new ComponentOptionModel();
             option.setName(getSafeValue("name", row));
+            option.setDisplayName(getSafeValue("displayName", row));
             option.setKind(getSafeValue("kind", row));
             option.setType(getSafeValue("type", row));
             option.setJavaType(getSafeValue("javaType", row));
@@ -1247,6 +1248,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo {
         for (Map<String, String> row : rows) {
             EndpointOptionModel option = new EndpointOptionModel();
             option.setName(getSafeValue("name", row));
+            option.setDisplayName(getSafeValue("displayName", row));
             option.setKind(getSafeValue("kind", row));
             option.setGroup(getSafeValue("group", row));
             option.setRequired(getSafeValue("required", row));
@@ -1285,6 +1287,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo {
         for (Map<String, String> row : rows) {
             DataFormatOptionModel option = new DataFormatOptionModel();
             option.setName(getSafeValue("name", row));
+            option.setDisplayName(getSafeValue("displayName", row));
             option.setKind(getSafeValue("kind", row));
             option.setType(getSafeValue("type", row));
             option.setJavaType(getSafeValue("javaType", row));
@@ -1318,6 +1321,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo {
         for (Map<String, String> row : rows) {
             LanguageOptionModel option = new LanguageOptionModel();
             option.setName(getSafeValue("name", row));
+            option.setDisplayName(getSafeValue("displayName", row));
             option.setKind(getSafeValue("kind", row));
             option.setType(getSafeValue("type", row));
             option.setJavaType(getSafeValue("javaType", row));

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/ComponentOptionModel.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/ComponentOptionModel.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/ComponentOptionModel.java
index 64142e4..e1c0697 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/ComponentOptionModel.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/ComponentOptionModel.java
@@ -19,6 +19,7 @@ package org.apache.camel.maven.packaging.model;
 public class ComponentOptionModel {
 
     private String name;
+    private String displayName;
     private String kind;
     private String group;
     private String required;
@@ -38,6 +39,14 @@ public class ComponentOptionModel {
         this.name = name;
     }
 
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public void setDisplayName(String displayName) {
+        this.displayName = displayName;
+    }
+
     public String getKind() {
         return kind;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/DataFormatOptionModel.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/DataFormatOptionModel.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/DataFormatOptionModel.java
index a194d06..9cac68c 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/DataFormatOptionModel.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/DataFormatOptionModel.java
@@ -19,6 +19,7 @@ package org.apache.camel.maven.packaging.model;
 public class DataFormatOptionModel {
 
     private String name;
+    private String displayName;
     private String kind;
     private String type;
     private String javaType;
@@ -35,6 +36,14 @@ public class DataFormatOptionModel {
         this.name = name;
     }
 
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public void setDisplayName(String displayName) {
+        this.displayName = displayName;
+    }
+
     public String getKind() {
         return kind;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/EipOptionModel.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/EipOptionModel.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/EipOptionModel.java
index 8ff61e63..c1cae8e 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/EipOptionModel.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/EipOptionModel.java
@@ -19,6 +19,7 @@ package org.apache.camel.maven.packaging.model;
 public class EipOptionModel {
 
     private String name;
+    private String displayName;
     private String title;
     private String javaType;
     private String label;
@@ -35,6 +36,14 @@ public class EipOptionModel {
         this.name = name;
     }
 
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public void setDisplayName(String displayName) {
+        this.displayName = displayName;
+    }
+
     public String getTitle() {
         return title;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/EndpointOptionModel.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/EndpointOptionModel.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/EndpointOptionModel.java
index 8155166..1cb6ed9 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/EndpointOptionModel.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/EndpointOptionModel.java
@@ -19,6 +19,7 @@ package org.apache.camel.maven.packaging.model;
 public class EndpointOptionModel {
 
     private String name;
+    private String displayName;
     private String kind;
     private String group;
     private String required;
@@ -41,6 +42,14 @@ public class EndpointOptionModel {
         this.name = name;
     }
 
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public void setDisplayName(String displayName) {
+        this.displayName = displayName;
+    }
+
     public String getKind() {
         return kind;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/357093bd/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/LanguageOptionModel.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/LanguageOptionModel.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/LanguageOptionModel.java
index 90e1a81..ea4240c 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/LanguageOptionModel.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/LanguageOptionModel.java
@@ -19,6 +19,7 @@ package org.apache.camel.maven.packaging.model;
 public class LanguageOptionModel {
 
     private String name;
+    private String displayName;
     private String kind;
     private String type;
     private String javaType;
@@ -35,6 +36,14 @@ public class LanguageOptionModel {
         this.name = name;
     }
 
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public void setDisplayName(String displayName) {
+        this.displayName = displayName;
+    }
+
     public String getKind() {
         return kind;
     }

Reply | Threaded
Open this post in threaded view
|

[4/4] camel git commit: CAMEL-10847: Component json schema - Include display name for options

davsclaus-2
In reply to this post by davsclaus-2
CAMEL-10847: Component json schema - Include display name for options


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fc39180d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fc39180d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fc39180d

Branch: refs/heads/master
Commit: fc39180dcab0a089ac7f1528d6e8550a8be96efb
Parents: 357093b
Author: Claus Ibsen <[hidden email]>
Authored: Thu Feb 16 21:43:59 2017 +0100
Committer: Claus Ibsen <[hidden email]>
Committed: Thu Feb 16 21:43:59 2017 +0100

----------------------------------------------------------------------
 .../salesforce/SalesforceEndpointConfig.java    | 18 +++++++--------
 .../camel/maven/connector/ConnectorMojo.java    |  3 ++-
 .../camel/maven/connector/JSonSchemaHelper.java | 10 ++++++++-
 .../camel/maven/connector/StringHelper.java     | 23 ++++++++++++++++++++
 .../main/resources/camel-connector-schema.json  |  6 ++---
 .../main/resources/camel-connector-schema.json  |  6 ++---
 .../main/resources/camel-connector-schema.json  | 12 +++++-----
 .../main/resources/camel-connector-schema.json  |  8 +++----
 .../main/resources/camel-connector-schema.json  |  4 ++--
 .../src/main/resources/camel-connector.json     |  2 +-
 10 files changed, 62 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/fc39180d/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java
index 99c9098..5e9c255 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java
@@ -97,23 +97,23 @@ public class SalesforceEndpointConfig implements Cloneable {
     // Rest API properties
     @UriParam
     private PayloadFormat format = PayloadFormat.JSON;
-    @UriParam
+    @UriParam(displayName = "SObject Name")
     private String sObjectName;
-    @UriParam
+    @UriParam(displayName = "SObject Id")
     private String sObjectId;
-    @UriParam
+    @UriParam(displayName = "SObject Fields")
     private String sObjectFields;
-    @UriParam
+    @UriParam(displayName = "SObject Id Name")
     private String sObjectIdName;
-    @UriParam
+    @UriParam(displayName = "SObject Id Value")
     private String sObjectIdValue;
-    @UriParam
+    @UriParam(displayName = "SObject Blob Field Name")
     private String sObjectBlobFieldName;
-    @UriParam
+    @UriParam(displayName = "SObject Class")
     private String sObjectClass;
-    @UriParam
+    @UriParam(displayName = "SObject Query")
     private String sObjectQuery;
-    @UriParam
+    @UriParam(displayName = "SObject Search")
     private String sObjectSearch;
     @UriParam
     private String apexMethod;

http://git-wip-us.apache.org/repos/asf/camel/blob/fc39180d/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/ConnectorMojo.java
----------------------------------------------------------------------
diff --git a/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/ConnectorMojo.java b/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/ConnectorMojo.java
index ff8a574..df192d9 100644
--- a/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/ConnectorMojo.java
+++ b/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/ConnectorMojo.java
@@ -454,6 +454,7 @@ public class ConnectorMojo extends AbstractJarMojo {
      */
     private static String buildJSonLineFromRow(Map<String, String> row) {
         String name = row.get("name");
+        String displayName = row.get("displayName");
         String kind = row.get("kind");
         boolean required = false;
         Object value = row.getOrDefault("required", "false");
@@ -502,7 +503,7 @@ public class ConnectorMojo extends AbstractJarMojo {
             multiValue = Boolean.valueOf(value.toString());
         }
 
-        return JSonSchemaHelper.toJson(name, kind, required, javaType, defaultValue, description, deprecated, secret, group, label,
+        return JSonSchemaHelper.toJson(name, displayName, kind, required, javaType, defaultValue, description, deprecated, secret, group, label,
             enumType, enums, false, null, false, optionalPrefix, prefix, multiValue);
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fc39180d/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/JSonSchemaHelper.java
----------------------------------------------------------------------
diff --git a/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/JSonSchemaHelper.java b/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/JSonSchemaHelper.java
index 4c968a7..4acdb25 100644
--- a/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/JSonSchemaHelper.java
+++ b/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/JSonSchemaHelper.java
@@ -41,7 +41,7 @@ public final class JSonSchemaHelper {
     private JSonSchemaHelper() {
     }
 
-    public static String toJson(String name, String kind, Boolean required, String type, String defaultValue, String description,
+    public static String toJson(String name, String displayName, String kind, Boolean required, String type, String defaultValue, String description,
                                 Boolean deprecated, Boolean secret, String group, String label, boolean enumType, Set<String> enums,
                                 boolean oneOfType, Set<String> oneOffTypes, boolean asPredicate, String optionalPrefix, String prefix, boolean multiValue) {
         String typeName = getType(type, enumType);
@@ -51,6 +51,14 @@ public final class JSonSchemaHelper {
         sb.append(": { \"kind\": ");
         sb.append(StringHelper.doubleQuote(kind));
 
+        // compute a display name if we don't have anything
+        if (StringHelper.isNullOrEmpty(displayName)) {
+            displayName = StringHelper.asTitle(name);
+        }
+        // we want display name early so its easier to spot
+        sb.append(", \"displayName\": ");
+        sb.append(StringHelper.doubleQuote(displayName));
+
         // we want group early so its easier to spot
         if (!StringHelper.isNullOrEmpty(group)) {
             sb.append(", \"group\": ");

http://git-wip-us.apache.org/repos/asf/camel/blob/fc39180d/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/StringHelper.java
----------------------------------------------------------------------
diff --git a/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/StringHelper.java b/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/StringHelper.java
index b3822a5..b69de06 100644
--- a/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/StringHelper.java
+++ b/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/StringHelper.java
@@ -149,4 +149,27 @@ public final class StringHelper {
         return text;
     }
 
+    /**
+     * Capitalizes the name as a title
+     *
+     * @param name  the name
+     * @return as a title
+     */
+    public static String asTitle(String name) {
+        StringBuilder sb = new StringBuilder();
+        for (char c : name.toCharArray()) {
+            boolean upper = Character.isUpperCase(c);
+            boolean first = sb.length() == 0;
+            if (first) {
+                sb.append(Character.toUpperCase(c));
+            } else if (upper) {
+                sb.append(' ');
+                sb.append(c);
+            } else {
+                sb.append(Character.toLowerCase(c));
+            }
+        }
+        return sb.toString().trim();
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/fc39180d/connectors/examples/bar-connector/src/main/resources/camel-connector-schema.json
----------------------------------------------------------------------
diff --git a/connectors/examples/bar-connector/src/main/resources/camel-connector-schema.json b/connectors/examples/bar-connector/src/main/resources/camel-connector-schema.json
index 18032b5..734c9f5 100644
--- a/connectors/examples/bar-connector/src/main/resources/camel-connector-schema.json
+++ b/connectors/examples/bar-connector/src/main/resources/camel-connector-schema.json
@@ -19,8 +19,8 @@
   "componentProperties": {
   },
   "properties": {
-    "drink": { "kind": "path", "group": "producer", "required": true, "type": "object", "javaType": "org.beverage.Beverages", "enum": [ "Wine", "GinTonic", "Beer" ], "deprecated": false, "secret": false, "description": "What drink to order" },
-    "amount": { "kind": "parameter", "group": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": 2, "description": "Number of drinks in the order" },
-    "celebrity": { "kind": "parameter", "group": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Is this a famous person ordering" }
+    "drink": { "kind": "path", "displayName": "Drink", "group": "producer", "required": true, "type": "object", "javaType": "org.beverage.Beverages", "enum": [ "Wine", "GinTonic", "Beer" ], "deprecated": false, "secret": false, "description": "What drink to order" },
+    "amount": { "kind": "parameter", "displayName": "Amount", "group": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": 2, "description": "Number of drinks in the order" },
+    "celebrity": { "kind": "parameter", "displayName": "Celebrity", "group": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Is this a famous person ordering" }
   }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/fc39180d/connectors/examples/foo-connector/src/main/resources/camel-connector-schema.json
----------------------------------------------------------------------
diff --git a/connectors/examples/foo-connector/src/main/resources/camel-connector-schema.json b/connectors/examples/foo-connector/src/main/resources/camel-connector-schema.json
index 303f978..6e877bd 100644
--- a/connectors/examples/foo-connector/src/main/resources/camel-connector-schema.json
+++ b/connectors/examples/foo-connector/src/main/resources/camel-connector-schema.json
@@ -19,8 +19,8 @@
   "componentProperties": {
   },
   "properties": {
-    "timerName": { "kind": "path", "group": "consumer", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The name of the timer" },
-    "period": { "kind": "parameter", "group": "consumer", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": 5000, "description": "If greater than 0 generate periodic events every period milliseconds. The default value is 1000. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour)." },
-    "repeatCount": { "kind": "parameter", "group": "consumer", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1 the timer will only fire once. If you set it to 5 it will only fire five times. A value of zero or negative means fire forever." }
+    "timerName": { "kind": "path", "displayName": "Timer Name", "group": "consumer", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The name of the timer" },
+    "period": { "kind": "parameter", "displayName": "Period", "group": "consumer", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": 5000, "description": "If greater than 0 generate periodic events every period milliseconds. The default value is 1000. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour)." },
+    "repeatCount": { "kind": "parameter", "displayName": "Repeat Count", "group": "consumer", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1 the timer will only fire once. If you set it to 5 it will only fire five times. A value of zero or negative means fire forever." }
   }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/fc39180d/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/camel-connector-schema.json
----------------------------------------------------------------------
diff --git a/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/camel-connector-schema.json b/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/camel-connector-schema.json
index 8030697..7fbb5dd 100644
--- a/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/camel-connector-schema.json
+++ b/connectors/examples/salesforce-upsert-contact-connector/src/main/resources/camel-connector-schema.json
@@ -17,13 +17,13 @@
     "version": "2.19.0-SNAPSHOT"
   },
   "componentProperties": {
-    "loginUrl": { "kind": "property", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "https://login.salesforce.com", "description": "Salesforce login URL defaults to https://login.salesforce.com" },
-    "clientId": { "kind": "property", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "Salesforce connected application Consumer Key" },
-    "clientSecret": { "kind": "property", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "Salesforce connected application Consumer Secret" },
-    "refreshToken": { "kind": "property", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "Salesforce connected application Consumer token" }
+    "loginUrl": { "kind": "property", "displayName": "Login Url", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "https://login.salesforce.com", "description": "Salesforce login URL defaults to https://login.salesforce.com" },
+    "clientId": { "kind": "property", "displayName": "Client Id", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "Salesforce connected application Consumer Key" },
+    "clientSecret": { "kind": "property", "displayName": "Client Secret", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "Salesforce connected application Consumer Secret" },
+    "refreshToken": { "kind": "property", "displayName": "Refresh Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "Salesforce connected application Consumer token" }
   },
   "properties": {
-    "sObjectIdName": { "kind": "parameter", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "SObject external ID field name" },
-    "sObjectIdValue": { "kind": "parameter", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "SObject external ID field value" }
+    "sObjectIdName": { "kind": "parameter", "displayName": "SObject Id Name", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "SObject external ID field name" },
+    "sObjectIdValue": { "kind": "parameter", "displayName": "SObject Id Value", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "SObject external ID field value" }
   }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/fc39180d/connectors/examples/twitter-mention-connector/src/main/resources/camel-connector-schema.json
----------------------------------------------------------------------
diff --git a/connectors/examples/twitter-mention-connector/src/main/resources/camel-connector-schema.json b/connectors/examples/twitter-mention-connector/src/main/resources/camel-connector-schema.json
index f139cac..113f006 100644
--- a/connectors/examples/twitter-mention-connector/src/main/resources/camel-connector-schema.json
+++ b/connectors/examples/twitter-mention-connector/src/main/resources/camel-connector-schema.json
@@ -17,10 +17,10 @@
     "version": "2.19.0-SNAPSHOT"
   },
   "componentProperties": {
-    "accessToken": { "kind": "property", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "The access token" },
-    "accessTokenSecret": { "kind": "property", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "The access token secret" },
-    "consumerKey": { "kind": "property", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "The consumer key" },
-    "consumerSecret": { "kind": "property", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "The consumer secret" }
+    "accessToken": { "kind": "property", "displayName": "Access Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "The access token" },
+    "accessTokenSecret": { "kind": "property", "displayName": "Access Token Secret", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "The access token secret" },
+    "consumerKey": { "kind": "property", "displayName": "Consumer Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "The consumer key" },
+    "consumerSecret": { "kind": "property", "displayName": "Consumer Secret", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "The consumer secret" }
   },
   "properties": {
   }

http://git-wip-us.apache.org/repos/asf/camel/blob/fc39180d/connectors/examples/wine-connector/src/main/resources/camel-connector-schema.json
----------------------------------------------------------------------
diff --git a/connectors/examples/wine-connector/src/main/resources/camel-connector-schema.json b/connectors/examples/wine-connector/src/main/resources/camel-connector-schema.json
index 859f2ed..8fc2009 100644
--- a/connectors/examples/wine-connector/src/main/resources/camel-connector-schema.json
+++ b/connectors/examples/wine-connector/src/main/resources/camel-connector-schema.json
@@ -19,7 +19,7 @@
   "componentProperties": {
   },
   "properties": {
-    "drink": { "kind": "path", "group": "producer", "required": true, "type": "object", "javaType": "org.beverage.Beverages", "enum": [ "Wine" ], "deprecated": false, "secret": false, "defaultValue": "Wine", "description": "You can only order wine" },
-    "amount": { "kind": "parameter", "group": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": 1, "description": "Number of drinks in the order" }
+    "drink": { "kind": "path", "displayName": "Wine Bottle", "group": "producer", "required": true, "type": "object", "javaType": "org.beverage.Beverages", "enum": [ "Wine" ], "deprecated": false, "secret": false, "defaultValue": "Wine", "description": "You can only order wine" },
+    "amount": { "kind": "parameter", "displayName": "Amount", "group": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": 1, "description": "Number of drinks in the order" }
   }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/fc39180d/connectors/examples/wine-connector/src/main/resources/camel-connector.json
----------------------------------------------------------------------
diff --git a/connectors/examples/wine-connector/src/main/resources/camel-connector.json b/connectors/examples/wine-connector/src/main/resources/camel-connector.json
index 7122db7..6c14a9f 100644
--- a/connectors/examples/wine-connector/src/main/resources/camel-connector.json
+++ b/connectors/examples/wine-connector/src/main/resources/camel-connector.json
@@ -18,6 +18,6 @@
     "drink": "Wine"
   },
   "endpointOverrides": {
-    "drink": { "enum": [ "Wine" ], "description": "You can only order wine" }
+    "drink": { "displayName": "Wine Bottle", "enum": [ "Wine" ], "description": "You can only order wine" }
   }
 }
\ No newline at end of file