You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2019/01/11 22:09:11 UTC
[camel] 06/13: Refactor deprecationNode -> deprecationNote
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 780a4667f5e0beeb6e4d9d83e53b5f12c213e641
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Jan 10 17:49:34 2019 +0100
Refactor deprecationNode -> deprecationNote
---
.../camel/model/language/JavaScriptExpression.java | 2 +-
.../apt/CoreEipAnnotationProcessorHelper.java | 42 +++++++++++-----------
.../tools/apt/EndpointAnnotationProcessor.java | 12 +++----
.../tools/apt/SpringAnnotationProcessorHelper.java | 6 ++--
.../camel/tools/apt/model/ComponentModel.java | 10 +++---
.../camel/tools/apt/model/ComponentOption.java | 14 ++++----
.../main/java/org/apache/camel/spi/Metadata.java | 2 +-
7 files changed, 44 insertions(+), 44 deletions(-)
diff --git a/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java b/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java
index e048c08..ecd7d3d 100644
--- a/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java
+++ b/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java
@@ -28,7 +28,7 @@ import org.apache.camel.spi.Metadata;
* @deprecated JavaScript is deprecated in Java 11 onwards
*/
@Metadata(firstVersion = "1.0.0", label = "language,script", title = "JavaScript",
- deprecationNode = "JavaScript is deprecated in Java 11 onwards")
+ deprecationNote = "JavaScript is deprecated in Java 11 onwards")
@XmlRootElement(name = "javaScript")
@XmlAccessorType(XmlAccessType.FIELD)
@Deprecated
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java
index 1219ee9..92a7a64 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java
@@ -175,8 +175,8 @@ public class CoreEipAnnotationProcessorHelper {
buffer.append("\n \"javaType\": \"").append(eipModel.getJavaType()).append("\",");
buffer.append("\n \"label\": \"").append(safeNull(eipModel.getLabel())).append("\",");
buffer.append("\n \"deprecated\": ").append(eipModel.isDeprecated()).append(",");
- if (eipModel.getDeprecationNode() != null) {
- buffer.append("\n \"deprecationNote\": \"").append(safeNull(eipModel.getDeprecationNode())).append("\",");
+ if (eipModel.getDeprecationNote() != null) {
+ buffer.append("\n \"deprecationNote\": \"").append(safeNull(eipModel.getDeprecationNote())).append("\",");
}
buffer.append("\n \"input\": ").append(eipModel.getInput()).append(",");
buffer.append("\n \"output\": ").append(eipModel.getOutput());
@@ -202,7 +202,7 @@ public class CoreEipAnnotationProcessorHelper {
String doc = entry.getDocumentation();
doc = sanitizeDescription(doc, false);
buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(), entry.getKind(), entry.isRequired(), entry.getType(), entry.getDefaultValue(), doc,
- entry.isDeprecated(), entry.getDeprecationNode(), false, null, null, entry.isEnumType(), entry.getEnums(), entry.isOneOf(), entry.getOneOfTypes(),
+ entry.isDeprecated(), entry.getDeprecationNote(), false, null, null, entry.isEnumType(), entry.getEnums(), entry.isOneOf(), entry.getOneOfTypes(),
entry.isAsPredicate(), null, null, false));
}
buffer.append("\n }");
@@ -394,7 +394,7 @@ public class CoreEipAnnotationProcessorHelper {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
EipOption ep = new EipOption(name, displayName, "attribute", fieldTypeName, required, defaultValue, docComment, deprecated, deprecationNote, isEnum, enums, false, null, false);
@@ -436,7 +436,7 @@ public class CoreEipAnnotationProcessorHelper {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
EipOption ep = new EipOption(name, displayName, "value", fieldTypeName, required, defaultValue, docComment, deprecated, deprecationNote, false, null, false, null, false);
@@ -538,7 +538,7 @@ public class CoreEipAnnotationProcessorHelper {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, required, defaultValue, docComment, deprecated, deprecationNote, isEnum, enums, isOneOf, oneOfTypes, asPredicate);
@@ -581,7 +581,7 @@ public class CoreEipAnnotationProcessorHelper {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, required, defaultValue, docComment, deprecated, deprecationNote, false, null, true, oneOfTypes, false);
@@ -819,7 +819,7 @@ public class CoreEipAnnotationProcessorHelper {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, true, "", "", deprecated, deprecationNote, false, null, true, oneOfTypes, false);
@@ -871,7 +871,7 @@ public class CoreEipAnnotationProcessorHelper {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, true, "", docComment, deprecated, deprecationNote, false, null, true, oneOfTypes, false);
@@ -934,7 +934,7 @@ public class CoreEipAnnotationProcessorHelper {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, true, "", docComment, deprecated, deprecationNote, false, null, true, oneOfTypes, asPredicate);
@@ -977,7 +977,7 @@ public class CoreEipAnnotationProcessorHelper {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, false, "", docComment, deprecated, deprecationNote, false, null, true, oneOfTypes, asPredicate);
@@ -1080,7 +1080,7 @@ public class CoreEipAnnotationProcessorHelper {
private String label;
private String description;
private boolean deprecated;
- private String deprecationNode;
+ private String deprecationNote;
private boolean input;
private boolean output;
private String firstVersion;
@@ -1133,12 +1133,12 @@ public class CoreEipAnnotationProcessorHelper {
this.deprecated = deprecated;
}
- public String getDeprecationNode() {
- return deprecationNode;
+ public String getDeprecationNote() {
+ return deprecationNote;
}
- public void setDeprecationNode(String deprecationNode) {
- this.deprecationNode = deprecationNode;
+ public void setDeprecationNote(String deprecationNote) {
+ this.deprecationNote = deprecationNote;
}
public boolean isInput() {
@@ -1184,7 +1184,7 @@ public class CoreEipAnnotationProcessorHelper {
private String defaultValue;
private String documentation;
private boolean deprecated;
- private String deprecationNode;
+ private String deprecationNote;
private boolean enumType;
private Set<String> enums;
private boolean oneOf;
@@ -1192,7 +1192,7 @@ public class CoreEipAnnotationProcessorHelper {
private boolean asPredicate;
private EipOption(String name, String displayName, String kind, String type, boolean required, String defaultValue, String documentation,
- boolean deprecated, String deprecationNode, boolean enumType, Set<String> enums, boolean oneOf, Set<String> oneOfTypes, boolean asPredicate) {
+ boolean deprecated, String deprecationNote, boolean enumType, Set<String> enums, boolean oneOf, Set<String> oneOfTypes, boolean asPredicate) {
this.name = name;
this.displayName = displayName;
this.kind = kind;
@@ -1201,7 +1201,7 @@ public class CoreEipAnnotationProcessorHelper {
this.defaultValue = defaultValue;
this.documentation = documentation;
this.deprecated = deprecated;
- this.deprecationNode = deprecationNode;
+ this.deprecationNote = deprecationNote;
this.enumType = enumType;
this.enums = enums;
this.oneOf = oneOf;
@@ -1241,8 +1241,8 @@ public class CoreEipAnnotationProcessorHelper {
return deprecated;
}
- public String getDeprecationNode() {
- return deprecationNode;
+ public String getDeprecationNote() {
+ return deprecationNote;
}
public boolean isEnumType() {
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 a1a1aba..3c4be09 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
@@ -189,7 +189,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
buffer.append("\n \"description\": \"").append(componentModel.getDescription()).append("\",");
buffer.append("\n \"label\": \"").append(getOrElse(componentModel.getLabel(), "")).append("\",");
buffer.append("\n \"deprecated\": ").append(componentModel.isDeprecated()).append(",");
- buffer.append("\n \"deprecationNote\": \"").append(getOrElse(componentModel.getDeprecationNode(), "")).append("\",");
+ buffer.append("\n \"deprecationNote\": \"").append(getOrElse(componentModel.getDeprecationNote(), "")).append("\",");
buffer.append("\n \"async\": ").append(componentModel.isAsync()).append(",");
buffer.append("\n \"consumerOnly\": ").append(componentModel.isConsumerOnly()).append(",");
buffer.append("\n \"producerOnly\": ").append(componentModel.isProducerOnly()).append(",");
@@ -238,7 +238,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
boolean asPredicate = false;
buffer.append(JsonSchemaHelper.toJson(entry.getName(), entry.getDisplayName(), "property", required, entry.getType(), defaultValue, doc,
- entry.isDeprecated(), entry.getDeprecationNode(), entry.isSecret(), entry.getGroup(), entry.getLabel(), entry.isEnumType(), entry.getEnums(),
+ entry.isDeprecated(), entry.getDeprecationNote(), entry.isSecret(), entry.getGroup(), entry.getLabel(), entry.isEnumType(), entry.getEnums(),
false, null, asPredicate, optionalPrefix, prefix, multiValue));
}
buffer.append("\n },");
@@ -405,9 +405,9 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
String deprecationNote = null;
if (endpointClassElement.getAnnotation(Metadata.class) != null) {
- deprecationNote = endpointClassElement.getAnnotation(Metadata.class).deprecationNode();
+ deprecationNote = endpointClassElement.getAnnotation(Metadata.class).deprecationNote();
}
- model.setDeprecationNode(deprecationNote);
+ model.setDeprecationNote(deprecationNote);
if (map.containsKey("groupId")) {
model.setGroupId(map.get("groupId"));
@@ -460,7 +460,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
Metadata metadata = method.getAnnotation(Metadata.class);
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
// must be the setter
@@ -584,7 +584,7 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
Boolean secret = metadata != null ? metadata.secret() : null;
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessorHelper.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessorHelper.java
index 484be88..58c6277 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessorHelper.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessorHelper.java
@@ -289,7 +289,7 @@ public class SpringAnnotationProcessorHelper {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
// special for id as its inherited from camel-core
@@ -424,7 +424,7 @@ public class SpringAnnotationProcessorHelper {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
EipOption ep = new EipOption(name, displayName, kind, fieldTypeName, required, defaultValue, docComment, deprecated, deprecationNote, isEnum, enums, oneOf, oneOfTypes, asPredicate);
@@ -470,7 +470,7 @@ public class SpringAnnotationProcessorHelper {
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
String deprecationNote = null;
if (metadata != null) {
- deprecationNote = metadata.deprecationNode();
+ deprecationNote = metadata.deprecationNote();
}
EipOption ep = new EipOption(name, kind, displayName, fieldTypeName, required, defaultValue, docComment, deprecated, deprecationNote, false, null, true, oneOfTypes, false);
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentModel.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentModel.java
index 3c696c2..99334c7 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentModel.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentModel.java
@@ -34,7 +34,7 @@ public final class ComponentModel {
private boolean consumerOnly;
private boolean producerOnly;
private boolean deprecated;
- private String deprecationNode;
+ private String deprecationNote;
private boolean lenientProperties;
private boolean async;
@@ -166,12 +166,12 @@ public final class ComponentModel {
this.deprecated = deprecated;
}
- public String getDeprecationNode() {
- return deprecationNode;
+ public String getDeprecationNote() {
+ return deprecationNote;
}
- public void setDeprecationNode(String deprecationNode) {
- this.deprecationNode = deprecationNode;
+ public void setDeprecationNote(String deprecationNote) {
+ this.deprecationNote = deprecationNote;
}
public boolean isLenientProperties() {
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 07cfb28..74f13ad 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
@@ -30,7 +30,7 @@ public final class ComponentOption {
private String defaultValueNote;
private String documentation;
private boolean deprecated;
- private String deprecationNode;
+ private String deprecationNote;
private boolean secret;
private String group;
private String label;
@@ -38,7 +38,7 @@ public final class ComponentOption {
private Set<String> enums;
public ComponentOption(String name, String displayName, String type, boolean required, String defaultValue, String defaultValueNote,
- String documentation, boolean deprecated, String deprecationNode, boolean secret, String group, String label,
+ String documentation, boolean deprecated, String deprecationNote, boolean secret, String group, String label,
boolean enumType, Set<String> enums) {
this.name = name;
this.displayName = displayName;
@@ -48,7 +48,7 @@ public final class ComponentOption {
this.defaultValueNote = defaultValueNote;
this.documentation = documentation;
this.deprecated = deprecated;
- this.deprecationNode = deprecationNode;
+ this.deprecationNote = deprecationNote;
this.secret = secret;
this.group = group;
this.label = label;
@@ -84,8 +84,8 @@ public final class ComponentOption {
return deprecated;
}
- public String getDeprecationNode() {
- return deprecationNode;
+ public String getDeprecationNote() {
+ return deprecationNote;
}
public boolean isSecret() {
@@ -100,8 +100,8 @@ public final class ComponentOption {
sb.append(". Default value notice: ").append(defaultValueNote);
}
- if (!isNullOrEmpty(deprecationNode)) {
- sb.append(". Deprecation note: ").append(deprecationNode);
+ if (!isNullOrEmpty(deprecationNote)) {
+ sb.append(". Deprecation note: ").append(deprecationNote);
}
return sb.toString();
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 a52e904..f5f7af6 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
@@ -98,6 +98,6 @@ public @interface Metadata {
/**
* Additional description that can explain the user about the deprecation and give reference to what to use instead.
*/
- String deprecationNode() default "";
+ String deprecationNote() default "";
}