camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [6/6] camel git commit: Added TODO which needs to be resolved for the recent rest-dsl PR
Date Sun, 17 May 2015 08:39:01 GMT
Added TODO which needs to be resolved for the recent rest-dsl PR


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

Branch: refs/heads/master
Commit: 0019f0b9ef5900d928d00a206c4bd1652912babd
Parents: 358ebfb
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sun May 17 10:43:05 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun May 17 10:43:05 2015 +0200

----------------------------------------------------------------------
 .../org/apache/camel/model/rest/RestOperationParam.java     | 9 +++++----
 .../org/apache/camel/model/rest/RestParamDefinition.java    | 2 ++
 .../java/org/apache/camel/model/rest/RestParamType.java     | 4 ++--
 .../java/org/apache/camel/model/rest/VerbDefinition.java    | 8 ++++----
 4 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0019f0b9/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParam.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParam.java
b/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParam.java
index 162396c..1a9c437 100644
--- a/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParam.java
+++ b/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParam.java
@@ -28,8 +28,11 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.camel.spi.Metadata;
 
-
-
+// TODO: rename to Definition as this is what this is
+// TODO: Do not set default values, but infer those
+// TODO: add javadoc on the setter methods
+// TODO: add @Metadata to define the default values
+// TODO: add required=true if its required (such as name and paramType I would assume)
 
 @Metadata(label = "rest")
 @XmlRootElement(name = "param")
@@ -63,9 +66,7 @@ public class RestOperationParam {
     @XmlAttribute
     String paramAccess;
 
-
     public RestOperationParam() {
-
     }
 
     public RestParamType getParamType() {

http://git-wip-us.apache.org/repos/asf/camel/blob/0019f0b9/camel-core/src/main/java/org/apache/camel/model/rest/RestParamDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/rest/RestParamDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/rest/RestParamDefinition.java
index 8801e7a..edc90dd 100644
--- a/camel-core/src/main/java/org/apache/camel/model/rest/RestParamDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/rest/RestParamDefinition.java
@@ -22,6 +22,8 @@ import org.apache.camel.model.OptionalIdentifiedDefinition;
 
 import javax.xml.bind.annotation.XmlTransient;
 
+// TODO: Should not be a Definition as its a builder for Java DSL instead.
+// instead the builder methods should be on RestOperationParam
 
 @XmlTransient
 public class RestParamDefinition extends OptionalIdentifiedDefinition<RestParamDefinition>
{

http://git-wip-us.apache.org/repos/asf/camel/blob/0019f0b9/camel-core/src/main/java/org/apache/camel/model/rest/RestParamType.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/rest/RestParamType.java b/camel-core/src/main/java/org/apache/camel/model/rest/RestParamType.java
index 8e1381a..b857f9f 100644
--- a/camel-core/src/main/java/org/apache/camel/model/rest/RestParamType.java
+++ b/camel-core/src/main/java/org/apache/camel/model/rest/RestParamType.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.model.rest;
 
-
 import javax.xml.bind.annotation.XmlEnum;
 import javax.xml.bind.annotation.XmlType;
 
@@ -26,6 +25,7 @@ import org.apache.camel.spi.Metadata;
 @XmlType
 @XmlEnum(String.class)
 public enum RestParamType {
-    header, query, body, path, form
+
+    body, form, header, path, query
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/0019f0b9/camel-core/src/main/java/org/apache/camel/model/rest/VerbDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/rest/VerbDefinition.java b/camel-core/src/main/java/org/apache/camel/model/rest/VerbDefinition.java
index 33442a3..56a4d89 100644
--- a/camel-core/src/main/java/org/apache/camel/model/rest/VerbDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/rest/VerbDefinition.java
@@ -35,8 +35,6 @@ import org.apache.camel.model.ToDefinition;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.util.FileUtil;
 
-
-
 /**
  * Rest command
  */
@@ -127,6 +125,10 @@ public class VerbDefinition extends OptionalIdentifiedDefinition<VerbDefinition>
         this.uri = uri;
         String path = this.rest.getPath();
 
+        // TODO: The setter should be a plain setter.
+        // this logic should be moved to
+        // org.apache.camel.model.rest.RestDefinition.asRouteDefinition()
+
         String s1 = FileUtil.stripTrailingSeparator(path);
         String s2 = FileUtil.stripLeadingSeparator(uri);
         String allPath;
@@ -146,8 +148,6 @@ public class VerbDefinition extends OptionalIdentifiedDefinition<VerbDefinition>
                 rest.restParam().name(key).type(RestParamType.path).endParam();
             }
         }
-
-
     }
 
     public String getConsumes() {


Mime
View raw message