camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: CAMEL-8195: Add javadoc to model classes so we have EIP documentation out of the box
Date Wed, 21 Jan 2015 11:03:50 GMT
Repository: camel
Updated Branches:
  refs/heads/master 76e9aab4f -> f0391afae


CAMEL-8195: Add javadoc to model classes so we have EIP documentation out of the box


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

Branch: refs/heads/master
Commit: 28ba3e9cef3146e4b9a44a8ca94a05ed5ebb0c4d
Parents: 76e9aab
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Jan 21 11:55:23 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Jan 21 11:55:23 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/model/DelayDefinition.java  |  9 +++++++++
 .../apache/camel/model/DynamicRouterDefinition.java   | 13 +++++++++++++
 .../java/org/apache/camel/model/FilterDefinition.java |  9 +++++++++
 .../camel/model/IdempotentConsumerDefinition.java     | 11 +++++++++++
 .../java/org/apache/camel/model/LoopDefinition.java   | 12 +++++++++++-
 .../apache/camel/model/RecipientListDefinition.java   | 11 +++++++++++
 .../org/apache/camel/model/RoutingSlipDefinition.java | 11 +++++++++++
 .../org/apache/camel/model/SetBodyDefinition.java     | 11 ++++++++++-
 .../apache/camel/model/SetFaultBodyDefinition.java    | 10 +++++++++-
 .../org/apache/camel/model/SetHeaderDefinition.java   |  9 +++++++++
 .../apache/camel/model/SetOutHeaderDefinition.java    |  9 +++++++++
 .../org/apache/camel/model/SetPropertyDefinition.java |  9 +++++++++
 .../java/org/apache/camel/model/SortDefinition.java   | 10 ++++++++++
 .../java/org/apache/camel/model/SplitDefinition.java  | 10 +++++++++-
 .../org/apache/camel/model/ThrottleDefinition.java    | 13 ++++++++++---
 .../org/apache/camel/model/TransformDefinition.java   | 12 +++++++++++-
 .../org/apache/camel/model/ValidateDefinition.java    | 12 ++++++++++++
 .../java/org/apache/camel/model/WhenDefinition.java   |  9 +++++++++
 .../camel/model/WhenSkipSendToEndpointDefinition.java | 10 ++++++++++
 .../camel/tools/apt/EipAnnotationProcessor.java       | 14 ++++++++++----
 20 files changed, 202 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/DelayDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/DelayDefinition.java b/camel-core/src/main/java/org/apache/camel/model/DelayDefinition.java
index b8dd1f1..edff990 100644
--- a/camel-core/src/main/java/org/apache/camel/model/DelayDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/DelayDefinition.java
@@ -156,6 +156,15 @@ public class DelayDefinition extends ExpressionNode implements ExecutorServiceAw
     // Properties
     // -------------------------------------------------------------------------
 
+    /**
+     * Expression to define how long time to wait (in millis)
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
     public Boolean getAsyncDelayed() {
         return asyncDelayed;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
index 855e077..861d348 100644
--- a/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
@@ -25,6 +25,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
+import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.DynamicRouter;
 import org.apache.camel.spi.Label;
 import org.apache.camel.spi.Metadata;
@@ -79,6 +80,18 @@ public class DynamicRouterDefinition<Type extends ProcessorDefinition<Type>>
ext
         return dynamicRouter;
     }
 
+    /**
+     * Expression to call that returns the endpoint(s) to route to in the dynamic routing.
+     * <p/>
+     * <b>Important:</b> The expression will be called in a while loop fashion,
until the expression returns <tt>null</tt>
+     * which means the dynamic router is finished.
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
     public void setUriDelimiter(String uriDelimiter) {
         this.uriDelimiter = uriDelimiter;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/FilterDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/FilterDefinition.java b/camel-core/src/main/java/org/apache/camel/model/FilterDefinition.java
index 7f3fa50..dc3775c 100644
--- a/camel-core/src/main/java/org/apache/camel/model/FilterDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/FilterDefinition.java
@@ -70,4 +70,13 @@ public class FilterDefinition extends ExpressionNode {
         return new FilterProcessor(createPredicate(routeContext), childProcessor);
     }
 
+    /**
+     * Expression to determine if the message should be filtered or not. If the expression
returns an empty value or <tt>false</tt>
+     * then the message is filtered (dropped), otherwise the message is continued being routed.
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerDefinition.java
index ed91903..9d4ec2c 100644
--- a/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerDefinition.java
@@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlTransient;
 
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
+import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.idempotent.IdempotentConsumer;
 import org.apache.camel.spi.IdempotentRepository;
 import org.apache.camel.spi.Label;
@@ -135,6 +136,16 @@ public class IdempotentConsumerDefinition extends ExpressionNode {
         return this;
     }
 
+    /**
+     * Expression used to calculate the correlation key to use for duplicate check.
+     * The Exchange which has the same correlation key is regarded as a duplicate and will
be rejected.
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
     public String getMessageIdRepositoryRef() {
         return messageIdRepositoryRef;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/LoopDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/LoopDefinition.java b/camel-core/src/main/java/org/apache/camel/model/LoopDefinition.java
index 5a27b76..3a592ff 100644
--- a/camel-core/src/main/java/org/apache/camel/model/LoopDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/LoopDefinition.java
@@ -96,5 +96,15 @@ public class LoopDefinition extends ExpressionNode {
         boolean isCopy = getCopy() != null && getCopy();
         return new LoopProcessor(output, getExpression().createExpression(routeContext),
isCopy);
     }
-    
+
+    /**
+     * Expression to define how many times we should loop. Notice the expression is only
evaluated once, and should return
+     * a number as how many times to loop. A value of zero or negative means no looping.
The loop is like a for-loop fashion,
+     * if you want a while loop, then the dynamic router may be a better choice.
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
index 0f13e77..4534210 100644
--- a/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
@@ -420,6 +420,17 @@ public class RecipientListDefinition<Type extends ProcessorDefinition<Type>>
ext
     // Properties
     //-------------------------------------------------------------------------
 
+
+    /**
+     * Expression that returns which endpoints (url) to send the message to (the recipients).
+     * If the expression return an empty value then the message is not sent to any recipients.
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
     public String getDelimiter() {
         return delimiter;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/RoutingSlipDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/RoutingSlipDefinition.java b/camel-core/src/main/java/org/apache/camel/model/RoutingSlipDefinition.java
index 5161cca..f2e045f 100644
--- a/camel-core/src/main/java/org/apache/camel/model/RoutingSlipDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/RoutingSlipDefinition.java
@@ -26,6 +26,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
+import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.model.language.HeaderExpression;
 import org.apache.camel.processor.RoutingSlip;
 import org.apache.camel.spi.Label;
@@ -100,6 +101,16 @@ public class RoutingSlipDefinition<Type extends ProcessorDefinition<Type>>
exten
         return Collections.emptyList();
     }
 
+    /**
+     * Expression to define the routing slip, which defines which endpoints to route the
message in a pipeline style.
+     * Notice the expression is evaluated once, if you want a more dynamic style, then the
dynamic router eip is a better choice.
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
     public void setUriDelimiter(String uriDelimiter) {
         this.uriDelimiter = uriDelimiter;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/SetBodyDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/SetBodyDefinition.java b/camel-core/src/main/java/org/apache/camel/model/SetBodyDefinition.java
index 4c9905f..508084f 100644
--- a/camel-core/src/main/java/org/apache/camel/model/SetBodyDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/SetBodyDefinition.java
@@ -22,6 +22,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
+import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.SetBodyProcessor;
 import org.apache.camel.spi.Label;
 import org.apache.camel.spi.RouteContext;
@@ -56,5 +57,13 @@ public class SetBodyDefinition extends NoOutputExpressionNode {
         Expression expr = getExpression().createExpression(routeContext);
         return new SetBodyProcessor(expr);
     }
-    
+
+    /**
+     * Expression that returns the new body to use
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/SetFaultBodyDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/SetFaultBodyDefinition.java b/camel-core/src/main/java/org/apache/camel/model/SetFaultBodyDefinition.java
index 5a48964..ece3dfc 100644
--- a/camel-core/src/main/java/org/apache/camel/model/SetFaultBodyDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/SetFaultBodyDefinition.java
@@ -23,6 +23,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.ProcessorBuilder;
+import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.spi.Label;
 import org.apache.camel.spi.RouteContext;
 
@@ -56,5 +57,12 @@ public class SetFaultBodyDefinition extends NoOutputExpressionNode {
         Expression expr = getExpression().createExpression(routeContext);
         return ProcessorBuilder.setFaultBody(expr);
     }
-    
+
+    /**
+     * Expression that returns the new fault body to use
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        super.setExpression(expression);
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/SetHeaderDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/SetHeaderDefinition.java b/camel-core/src/main/java/org/apache/camel/model/SetHeaderDefinition.java
index ee26d05..be1a45c 100644
--- a/camel-core/src/main/java/org/apache/camel/model/SetHeaderDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/SetHeaderDefinition.java
@@ -77,6 +77,15 @@ public class SetHeaderDefinition extends NoOutputExpressionNode {
     }
 
     /**
+     * Expression to return the value of the header
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
+    /**
      * Name of message header to set a new value
      */
     @Required

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderDefinition.java b/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderDefinition.java
index bcf5e80..29835a6 100644
--- a/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderDefinition.java
@@ -75,6 +75,15 @@ public class SetOutHeaderDefinition extends NoOutputExpressionNode {
     }
 
     /**
+     * Expression to return the value of the header
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
+    /**
      * Name of message header to set a new value
      */
     @Required

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/SetPropertyDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/SetPropertyDefinition.java b/camel-core/src/main/java/org/apache/camel/model/SetPropertyDefinition.java
index 64e1da1..db9b549 100644
--- a/camel-core/src/main/java/org/apache/camel/model/SetPropertyDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/SetPropertyDefinition.java
@@ -77,6 +77,15 @@ public class SetPropertyDefinition extends NoOutputExpressionNode {
     }
 
     /**
+     * Expression to return the value of the message exchange property
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
+    /**
      * Name of exchange property to set a new value
      */
     @Required

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/SortDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/SortDefinition.java b/camel-core/src/main/java/org/apache/camel/model/SortDefinition.java
index a614255..198cd6a 100644
--- a/camel-core/src/main/java/org/apache/camel/model/SortDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/SortDefinition.java
@@ -26,6 +26,7 @@ import javax.xml.bind.annotation.XmlTransient;
 
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
+import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.SortProcessor;
 import org.apache.camel.spi.Label;
 import org.apache.camel.spi.RouteContext;
@@ -93,6 +94,15 @@ public class SortDefinition<T> extends NoOutputExpressionNode {
         return new SortProcessor<T>(exp, getComparator());
     }
 
+    /**
+     * Optional expression to sort by something else than the message body
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
     public Comparator<? super T> getComparator() {
         return comparator;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java b/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java
index 70aa71c..697c747 100644
--- a/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java
@@ -100,7 +100,6 @@ public class SplitDefinition extends ExpressionNode implements ExecutorServiceAw
         Processor childProcessor = this.createChildProcessor(routeContext, true);
         aggregationStrategy = createAggregationStrategy(routeContext);
 
-
         boolean isParallelProcessing = getParallelProcessing() != null && getParallelProcessing();
         boolean isStreaming = getStreaming() != null && getStreaming();
         boolean isShareUnitOfWork = getShareUnitOfWork() != null && getShareUnitOfWork();
@@ -337,6 +336,15 @@ public class SplitDefinition extends ExpressionNode implements ExecutorServiceAw
     // Properties
     //-------------------------------------------------------------------------
 
+    /**
+     * Expression of how to split the message body, such as as-is, using a tokenizer, or
using an xpath.
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
     public AggregationStrategy getAggregationStrategy() {
         return aggregationStrategy;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java b/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
index c38b5ce..cd7131f 100644
--- a/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
@@ -18,7 +18,6 @@ package org.apache.camel.model;
 
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.ScheduledExecutorService;
-
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
@@ -28,6 +27,7 @@ import javax.xml.bind.annotation.XmlTransient;
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.ExpressionBuilder;
+import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.Throttler;
 import org.apache.camel.spi.Label;
 import org.apache.camel.spi.Metadata;
@@ -199,12 +199,19 @@ public class ThrottleDefinition extends ExpressionNode implements ExecutorServic
         setExecutorServiceRef(executorServiceRef);
         return this;
     }
-    
-    
 
     // Properties
     // -------------------------------------------------------------------------
 
+    /**
+     * Expression to configure the maximum number of messages to throttle per request
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
     public Long getTimePeriodMillis() {
         return timePeriodMillis;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/TransformDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/TransformDefinition.java b/camel-core/src/main/java/org/apache/camel/model/TransformDefinition.java
index 14a6f3d..225bba6 100644
--- a/camel-core/src/main/java/org/apache/camel/model/TransformDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/TransformDefinition.java
@@ -22,6 +22,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
+import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.TransformProcessor;
 import org.apache.camel.spi.Label;
 import org.apache.camel.spi.RouteContext;
@@ -56,5 +57,14 @@ public class TransformDefinition extends NoOutputExpressionNode {
         Expression expr = getExpression().createExpression(routeContext);
         return new TransformProcessor(expr);
     }
-    
+
+    /**
+     * Expression to return the transformed message body (the new message body to use)
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/ValidateDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/ValidateDefinition.java b/camel-core/src/main/java/org/apache/camel/model/ValidateDefinition.java
index 944febe..2f102e1 100644
--- a/camel-core/src/main/java/org/apache/camel/model/ValidateDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/ValidateDefinition.java
@@ -21,6 +21,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.camel.Predicate;
+import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.validation.PredicateValidatingProcessor;
 import org.apache.camel.spi.Label;
 import org.apache.camel.spi.RouteContext;
@@ -54,4 +55,15 @@ public class ValidateDefinition extends NoOutputExpressionNode {
         return new PredicateValidatingProcessor(pred);
     }
 
+    /**
+     * Expression to use for validation as a predicate. The expression should return either
<tt>true</tt> or <tt>false</tt>.
+     * If returning <tt>false</tt> the message is invalid and an exception is
thrown.
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/WhenDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/WhenDefinition.java b/camel-core/src/main/java/org/apache/camel/model/WhenDefinition.java
index 40bbce1..3ab297d 100644
--- a/camel-core/src/main/java/org/apache/camel/model/WhenDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/WhenDefinition.java
@@ -74,6 +74,15 @@ public class WhenDefinition extends ExpressionNode {
         return createFilterProcessor(routeContext);
     }
 
+    /**
+     * Expression used as the predicate to evaluate whether this when should trigger and
route the message or not.
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
     @Override
     public ProcessorDefinition<?> endParent() {
         // when using when in the DSL we don't want to end back to this when, but instead

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/camel-core/src/main/java/org/apache/camel/model/WhenSkipSendToEndpointDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/WhenSkipSendToEndpointDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/WhenSkipSendToEndpointDefinition.java
index 6d8a371..09fa17b 100644
--- a/camel-core/src/main/java/org/apache/camel/model/WhenSkipSendToEndpointDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/WhenSkipSendToEndpointDefinition.java
@@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Predicate;
+import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.spi.Label;
 import org.apache.camel.spi.RouteContext;
 
@@ -50,4 +51,13 @@ public class WhenSkipSendToEndpointDefinition extends WhenDefinition {
         };
     }
 
+    /**
+     * Expression used as the predicate to evaluate whether the message should be sent or
not to the endpoint
+     */
+    @Override
+    public void setExpression(ExpressionDefinition expression) {
+        // override to include javadoc what the expression is used for
+        super.setExpression(expression);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/28ba3e9c/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java
b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java
index 755fa05..e4b2f6e 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java
@@ -251,7 +251,7 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor
{
                     processOutputs(roundEnv, originalClassType, elementRef, fieldElement,
fieldName, eipOptions, prefix);
 
                     // special for expression
-                    processExpression(roundEnv, elementRef, fieldElement, fieldName, eipOptions,
prefix);
+                    processRefExpression(roundEnv, originalClassType, classElement, elementRef,
fieldElement, fieldName, eipOptions, prefix);
                 }
             }
 
@@ -555,8 +555,11 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor
{
     /**
      * Special for processing an @XmlElementRef expression field
      */
-    private void processExpression(RoundEnvironment roundEnv, XmlElementRef elementRef, VariableElement
fieldElement,
-                                   String fieldName, Set<EipOption> eipOptions, String
prefix) {
+    private void processRefExpression(RoundEnvironment roundEnv, TypeElement originalClassElement,
TypeElement classElement,
+                                      XmlElementRef elementRef, VariableElement fieldElement,
+                                      String fieldName, Set<EipOption> eipOptions,
String prefix) {
+        Elements elementUtils = processingEnv.getElementUtils();
+
         if ("expression".equals(fieldName)) {
             String kind = "element";
             String name = elementRef.name();
@@ -567,6 +570,9 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor
{
             TypeMirror fieldType = fieldElement.asType();
             String fieldTypeName = fieldType.toString();
 
+            // find javadoc from original class as it will override the setExpression method
where we can provide the javadoc for the given EIP
+            String docComment = findJavaDoc(elementUtils, fieldElement, fieldName, name,
originalClassElement, true);
+
             // gather oneOf expression/predicates which uses language
             Set<String> oneOfTypes = new TreeSet<String>();
             TypeElement languages = findTypeElement(roundEnv, ONE_OF_LANGUAGES);
@@ -586,7 +592,7 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor
{
 
             boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
 
-            EipOption ep = new EipOption(name, kind, fieldTypeName, true, "", "", deprecated,
false, null, true, oneOfTypes);
+            EipOption ep = new EipOption(name, kind, fieldTypeName, true, "", docComment,
deprecated, false, null, true, oneOfTypes);
             eipOptions.add(ep);
         }
     }


Mime
View raw message