You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/01/18 11:43:42 UTC

camel git commit: CAMEL-10720: The generated XML XSD now includes deprecated in the documentation so users can see this in their IDEs.

Repository: camel
Updated Branches:
  refs/heads/master 59b3a9341 -> fe1ef1670


CAMEL-10720: The generated XML XSD now includes deprecated in the documentation so users can see this in their IDEs.


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

Branch: refs/heads/master
Commit: fe1ef167093e17ec159dc573c707f6c848513113
Parents: 59b3a93
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jan 18 12:43:33 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jan 18 12:43:33 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/maven/Constants.java        | 1 +
 .../java/org/apache/camel/maven/DocumentationEnricher.java     | 6 ++++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/fe1ef167/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/Constants.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/Constants.java b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/Constants.java
index 20de72c..10771ec 100644
--- a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/Constants.java
+++ b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/Constants.java
@@ -38,6 +38,7 @@ public final class Constants {
     public static final String JSON_SUFIX = ".json";
     public static final String DESCRIPTION_ATTRIBUTE_NAME = "description";
     public static final String DEFAULT_VALUE_ATTRIBUTE_NAME = "defaultValue";
+    public static final String DEPRECATED_ATTRIBUTE_NAME = "deprecated";
     public static final String MODEL_ATTRIBUTE_NAME = "model";
 
     private Constants() { }

http://git-wip-us.apache.org/repos/asf/camel/blob/fe1ef167/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java
index 6402b57..02dcc34 100644
--- a/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java
+++ b/tooling/maven/camel-eip-documentation-enricher-maven-plugin/src/main/java/org/apache/camel/maven/DocumentationEnricher.java
@@ -81,12 +81,14 @@ public class DocumentationEnricher {
 
         String descriptionText = null;
         String defaultValueText = null;
+        String deprecatedText = null;
 
         List<Map<String, String>> rows = JsonSchemaHelper.parseJsonSchema(Constants.PROPERTIES_ATTRIBUTE_NAME, PackageHelper.fileToString(jsonFile), true);
         for (Map<String, String> row : rows) {
             if (name.equals(row.get(Constants.NAME_ATTRIBUTE_NAME))) {
                 descriptionText = row.get(Constants.DESCRIPTION_ATTRIBUTE_NAME);
                 defaultValueText = row.get(Constants.DEFAULT_VALUE_ATTRIBUTE_NAME);
+                deprecatedText = row.get(Constants.DEPRECATED_ATTRIBUTE_NAME);
             }
         }
 
@@ -97,6 +99,10 @@ public class DocumentationEnricher {
             defaultValueText = "true";
         }
 
+        if ("true".equals(deprecatedText)) {
+            descriptionText = "Deprecated: " + descriptionText;
+        }
+
         if (!isNullOrEmpty(descriptionText)) {
             String text = descriptionText;
             if (!isNullOrEmpty(defaultValueText)) {