CAMEL-11168: Add deprecationNote to @Metadata

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

Branch: refs/heads/master
Commit: b36348d98fa99584a0d2dec3c5b8eac35f44e253
Parents: 79c24e2
Author: Claus Ibsen <[email protected]>
Authored: Thu Jul 20 16:21:48 2017 +0200
Committer: Claus Ibsen <[email protected]>
Committed: Thu Jul 20 16:48:21 2017 +0200

----------------------------------------------------------------------
 .../camel-ejb/src/main/docs/ejb-component.adoc  |  2 +-
 .../camel/maven/packaging/UpdateReadmeMojo.java | 72 ++++++++++++++++++++
 2 files changed, 73 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b36348d9/components/camel-ejb/src/main/docs/ejb-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-ejb/src/main/docs/ejb-component.adoc 
b/components/camel-ejb/src/main/docs/ejb-component.adoc
index bd0a44d..42406b6 100644
--- a/components/camel-ejb/src/main/docs/ejb-component.adoc
+++ b/components/camel-ejb/src/main/docs/ejb-component.adoc
@@ -70,7 +70,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | **method** (producer) | Sets the name of the method to invoke on the bean |  
| String
 | **cache** (advanced) | If enabled Camel will cache the result of the first 
Registry look-up. Cache can be enabled if the bean in the Registry is defined 
as a singleton scope. | false | boolean
-| **multiParameterArray** (advanced) | How to treat the parameters which are 
passed from the message body.true means the message body should be an array of 
parameters. Note: This option is used internally by Camel and is not intended 
for end users to use. | false | boolean
+| **multiParameterArray** (advanced) | How to treat the parameters which are 
passed from the message body.true means the message body should be an array of 
parameters.. Deprecation note: This option is used internally by Camel and is 
not intended for end users to use. | false | boolean
 | **parameters** (advanced) | Used for configuring additional properties on 
the bean |  | Map
 | **synchronous** (advanced) | Sets whether synchronous processing should be 
strictly used or Camel is allowed to use asynchronous processing (if 
supported). | false | boolean
 |=======================================================================

http://git-wip-us.apache.org/repos/asf/camel/blob/b36348d9/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateReadmeMojo.java
----------------------------------------------------------------------
diff --git 
a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateReadmeMojo.java
 
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateReadmeMojo.java
index 654d0c7..9d83038 100644
--- 
a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateReadmeMojo.java
+++ 
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/UpdateReadmeMojo.java
@@ -797,6 +797,20 @@ public class UpdateReadmeMojo extends AbstractMojo {
                 String desc = "*Required* " + option.getDescription();
                 option.setDescription(desc);
             }
+            // is the option deprecated then include that as well in the 
description
+            if ("true".equals(option.getDeprecated())) {
+                String desc = "*Deprecated* " + option.getDescription();
+                option.setDescription(desc);
+                if (!StringHelper.isEmpty(option.getDeprecationNote())) {
+                    desc = option.getDescription();
+                    if (!desc.endsWith(".")) {
+                        desc = desc + ". Deprecation note: " + 
option.getDeprecationNote();
+                    } else {
+                        desc = desc + " Deprecation note: " + 
option.getDeprecationNote();
+                    }
+                    option.setDescription(desc);
+                }
+            }
             component.addComponentOption(option);
 
             // group separate between different options
@@ -830,6 +844,20 @@ public class UpdateReadmeMojo extends AbstractMojo {
                 String desc = "*Required* " + option.getDescription();
                 option.setDescription(desc);
             }
+            // is the option deprecated then include that as well in the 
description
+            if ("true".equals(option.getDeprecated())) {
+                String desc = "*Deprecated* " + option.getDescription();
+                option.setDescription(desc);
+                if (!StringHelper.isEmpty(option.getDeprecationNote())) {
+                    desc = option.getDescription();
+                    if (!desc.endsWith(".")) {
+                        desc = desc + ". Deprecation note: " + 
option.getDeprecationNote();
+                    } else {
+                        desc = desc + " Deprecation note: " + 
option.getDeprecationNote();
+                    }
+                    option.setDescription(desc);
+                }
+            }
             // separate the options in path vs parameter so we can generate 
two different tables
             if ("path".equals(option.getKind())) {
                 component.addEndpointPathOption(option);
@@ -884,6 +912,21 @@ public class UpdateReadmeMojo extends AbstractMojo {
                 String doc = option.getDescription() + " The default value is 
either Csv or KeyValue depending on chosen dataformat.";
                 option.setDescription(doc);
             }
+            // lets put required in the description
+            // is the option deprecated then include that as well in the 
description
+            if ("true".equals(option.getDeprecated())) {
+                String desc = "*Deprecated* " + option.getDescription();
+                option.setDescription(desc);
+                if (!StringHelper.isEmpty(option.getDeprecationNote())) {
+                    desc = option.getDescription();
+                    if (!desc.endsWith(".")) {
+                        desc = desc + ". Deprecation note: " + 
option.getDeprecationNote();
+                    } else {
+                        desc = desc + " Deprecation note: " + 
option.getDeprecationNote();
+                    }
+                    option.setDescription(desc);
+                }
+            }
 
             // skip option named id
             if ("id".equals(option.getName())) {
@@ -927,6 +970,21 @@ public class UpdateReadmeMojo extends AbstractMojo {
             option.setDefaultValue(getSafeValue("defaultValue", row));
             option.setDescription(getSafeValue("description", row));
 
+            // is the option deprecated then include that as well in the 
description
+            if ("true".equals(option.getDeprecated())) {
+                String desc = "*Deprecated* " + option.getDescription();
+                option.setDescription(desc);
+                if (!StringHelper.isEmpty(option.getDeprecationNote())) {
+                    desc = option.getDescription();
+                    if (!desc.endsWith(".")) {
+                        desc = desc + ". Deprecation note: " + 
option.getDeprecationNote();
+                    } else {
+                        desc = desc + " Deprecation note: " + 
option.getDeprecationNote();
+                    }
+                    option.setDescription(desc);
+                }
+            }
+
             // skip option named id/expression
             if ("id".equals(option.getName()) || 
"expression".equals(option.getName())) {
                 getLog().debug("Skipping option: " + option.getName());
@@ -971,6 +1029,20 @@ public class UpdateReadmeMojo extends AbstractMojo {
                 String desc = "*Required* " + option.getDescription();
                 option.setDescription(desc);
             }
+            // is the option deprecated then include that as well in the 
description
+            if (option.isDeprecated()) {
+                String desc = "*Deprecated* " + option.getDescription();
+                option.setDescription(desc);
+                if (!StringHelper.isEmpty(option.getDeprecationNote())) {
+                    desc = option.getDescription();
+                    if (!desc.endsWith(".")) {
+                        desc = desc + ". Deprecation note: " + 
option.getDeprecationNote();
+                    } else {
+                        desc = desc + " Deprecation note: " + 
option.getDeprecationNote();
+                    }
+                    option.setDescription(desc);
+                }
+            }
 
             // skip option named id/description/expression/outputs
             if ("id".equals(option.getName()) || 
"description".equals(option.getName())

Reply via email to