camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/4] camel git commit: CAMEL-8195: Add javadoc to model classes so we have EIP documentation out of the box
Date Mon, 19 Jan 2015 13:35:13 GMT
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/780c0964
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/780c0964
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/780c0964

Branch: refs/heads/master
Commit: 780c09640167e82babe8f6495b414297f986084e
Parents: 0d1bd02
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Jan 19 13:47:47 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Jan 19 14:28:16 2015 +0100

----------------------------------------------------------------------
 .../org/apache/camel/model/CatchDefinition.java | 21 +++++++++++++--
 .../camel/model/ContextScanDefinition.java      |  6 +++++
 .../camel/model/ConvertBodyDefinition.java      |  6 +++++
 .../org/apache/camel/model/DelayDefinition.java |  8 ++++--
 .../camel/model/DescriptionDefinition.java      | 27 ++++++++++++++++++-
 .../apache/camel/model/EnrichDefinition.java    | 28 ++++++++++++++++++++
 .../camel/model/InterceptFromDefinition.java    |  4 +++
 .../InterceptSendToEndpointDefinition.java      |  8 +++++-
 .../camel/model/PackageScanDefinition.java      |  4 ++-
 .../camel/model/config/PropertyDefinition.java  |  3 +++
 10 files changed, 108 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/780c0964/camel-core/src/main/java/org/apache/camel/model/CatchDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/CatchDefinition.java b/camel-core/src/main/java/org/apache/camel/model/CatchDefinition.java
index 6f6186b..1556218 100644
--- a/camel-core/src/main/java/org/apache/camel/model/CatchDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/CatchDefinition.java
@@ -18,7 +18,6 @@ package org.apache.camel.model;
 
 import java.util.ArrayList;
 import java.util.List;
-
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -137,7 +136,7 @@ public class CatchDefinition extends ProcessorDefinition<CatchDefinition>
{
     // Fluent API
     //-------------------------------------------------------------------------
     /**
-     * Sets the exceptionClasses of the CatchType
+     * The exceptions to catch.
      *
      * @param exceptionClasses  a list of the exception classes
      * @return the builder
@@ -146,6 +145,24 @@ public class CatchDefinition extends ProcessorDefinition<CatchDefinition>
{
         setExceptionClasses(exceptionClasses);
         return this;
     }
+
+    /**
+     * The exception(s) to catch.
+     *
+     * @param exceptions  one or more exceptions
+     * @return the builder
+     */
+    public CatchDefinition exception(Class<? extends Throwable>... exceptions) {
+        if (exceptionClasses == null) {
+            exceptionClasses = new ArrayList<Class<? extends Throwable>>();
+        }
+        if (exceptions != null) {
+            for (Class<? extends Throwable> exception : exceptions) {
+                exceptionClasses.add(exception);
+            }
+        }
+        return this;
+    }
     
     /**
      * Sets an additional predicate that should be true before the onCatch is triggered.

http://git-wip-us.apache.org/repos/asf/camel/blob/780c0964/camel-core/src/main/java/org/apache/camel/model/ContextScanDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/ContextScanDefinition.java b/camel-core/src/main/java/org/apache/camel/model/ContextScanDefinition.java
index b349d54..62a16df 100644
--- a/camel-core/src/main/java/org/apache/camel/model/ContextScanDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/ContextScanDefinition.java
@@ -48,10 +48,16 @@ public class ContextScanDefinition {
         return includes;
     }
 
+    /**
+     * Exclude finding route builder from these java package names.
+     */
     public void setExcludes(List<String> excludes) {
         this.excludes = excludes;
     }
 
+    /**
+     * Include finding route builder from these java package names.
+     */
     public void setIncludes(List<String> includes) {
         this.includes = includes;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/780c0964/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java b/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java
index 1363c22..cc0a0c7 100644
--- a/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java
@@ -100,6 +100,9 @@ public class ConvertBodyDefinition extends NoOutputDefinition<ConvertBodyDefinit
         return type;
     }
 
+    /**
+     * The java type to convert to
+     */
     @Required
     public void setType(String type) {
         this.type = type;
@@ -117,6 +120,9 @@ public class ConvertBodyDefinition extends NoOutputDefinition<ConvertBodyDefinit
         return charset;
     }
 
+    /**
+     * To use a specific charset when converting
+     */
     public void setCharset(String charset) {
         this.charset = charset;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/780c0964/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 08ac112..75d48e9 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
@@ -129,19 +129,23 @@ public class DelayDefinition extends ExpressionNode implements ExecutorServiceAw
 
     /**
      * Enables asynchronous delay which means the thread will <b>noy</b> block
while delaying.
-     *
-     * @return the builder
      */
     public DelayDefinition asyncDelayed() {
         setAsyncDelayed(true);
         return this;
     }
 
+    /**
+     * To use a custom Thread Pool if asyncDelay has been enabled.
+     */
     public DelayDefinition executorService(ExecutorService executorService) {
         setExecutorService(executorService);
         return this;
     }
 
+    /**
+     * Refers to a custom Thread Pool if asyncDelay has been enabled.
+     */
     public DelayDefinition executorServiceRef(String executorServiceRef) {
         setExecutorServiceRef(executorServiceRef);
         return this;

http://git-wip-us.apache.org/repos/asf/camel/blob/780c0964/camel-core/src/main/java/org/apache/camel/model/DescriptionDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/DescriptionDefinition.java b/camel-core/src/main/java/org/apache/camel/model/DescriptionDefinition.java
index 5301a15..8caec77 100644
--- a/camel-core/src/main/java/org/apache/camel/model/DescriptionDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/DescriptionDefinition.java
@@ -22,23 +22,30 @@ import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlValue;
 
+import org.apache.camel.spi.Label;
+
 /**
- * Represents a description element which can be used on any element in the EIP route
+ * To provide comments about the node.
  *
  * @version 
  */
+@Label("configuration")
 @XmlRootElement(name = "description")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class DescriptionDefinition {
     @XmlAttribute
     private String lang;
     @XmlAttribute
+    @Deprecated
     private Double layoutX;
     @XmlAttribute
+    @Deprecated
     private Double layoutY;
     @XmlAttribute
+    @Deprecated
     private Double layoutWidth;
     @XmlAttribute
+    @Deprecated
     private Double layoutHeight;
     @XmlValue
     private String text;
@@ -47,6 +54,9 @@ public class DescriptionDefinition {
         return lang;
     }
 
+    /**
+     * Language, such as en for english.
+     */
     public void setLang(String lang) {
         this.lang = lang;
     }
@@ -55,6 +65,9 @@ public class DescriptionDefinition {
         return text;
     }
 
+    /**
+     * The description as human readable text
+     */
     public void setText(String text) {
         this.text = text;
     }
@@ -63,6 +76,9 @@ public class DescriptionDefinition {
         return layoutHeight;
     }
 
+    /**
+     * Layout height
+     */
     public void setLayoutHeight(Double layoutHeight) {
         this.layoutHeight = layoutHeight;
     }
@@ -71,6 +87,9 @@ public class DescriptionDefinition {
         return layoutWidth;
     }
 
+    /**
+     * Layout width
+     */
     public void setLayoutWidth(Double layoutWidth) {
         this.layoutWidth = layoutWidth;
     }
@@ -79,6 +98,9 @@ public class DescriptionDefinition {
         return layoutX;
     }
 
+    /**
+     * Layout position X
+     */
     public void setLayoutX(Double layoutX) {
         this.layoutX = layoutX;
     }
@@ -87,6 +109,9 @@ public class DescriptionDefinition {
         return layoutY;
     }
 
+    /**
+     * Layout position Y
+     */
     public void setLayoutY(Double layoutY) {
         this.layoutY = layoutY;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/780c0964/camel-core/src/main/java/org/apache/camel/model/EnrichDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/EnrichDefinition.java b/camel-core/src/main/java/org/apache/camel/model/EnrichDefinition.java
index 8886d60..9ff0a19 100644
--- a/camel-core/src/main/java/org/apache/camel/model/EnrichDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/EnrichDefinition.java
@@ -149,6 +149,9 @@ public class EnrichDefinition extends NoOutputDefinition<EnrichDefinition>
imple
         return resourceUri;
     }
 
+    /**
+     * The endpoint uri for the external service to enrich from. You must use either uri
or ref.
+     */
     public void setResourceUri(String resourceUri) {
         this.resourceUri = resourceUri;
     }
@@ -157,6 +160,9 @@ public class EnrichDefinition extends NoOutputDefinition<EnrichDefinition>
imple
         return resourceRef;
     }
 
+    /**
+     * Refers to the endpoint for the external service to enrich from. You must use either
uri or ref.
+     */
     public void setResourceRef(String resourceRef) {
         this.resourceRef = resourceRef;
     }
@@ -165,6 +171,10 @@ public class EnrichDefinition extends NoOutputDefinition<EnrichDefinition>
imple
         return aggregationStrategyRef;
     }
 
+    /**
+     * Refers to an AggregationStrategy to be used to merge the reply from the external service,
into a single outgoing message.
+     * By default Camel will use the reply from the external service as outgoing message.
+     */
     public void setAggregationStrategyRef(String aggregationStrategyRef) {
         this.aggregationStrategyRef = aggregationStrategyRef;
     }
@@ -173,6 +183,9 @@ public class EnrichDefinition extends NoOutputDefinition<EnrichDefinition>
imple
         return aggregationStrategyMethodName;
     }
 
+    /**
+     * This option can be used to explicit declare the method name to use, when using POJOs
as the AggregationStrategy.
+     */
     public void setAggregationStrategyMethodName(String aggregationStrategyMethodName) {
         this.aggregationStrategyMethodName = aggregationStrategyMethodName;
     }
@@ -181,6 +194,11 @@ public class EnrichDefinition extends NoOutputDefinition<EnrichDefinition>
imple
         return aggregationStrategyMethodAllowNull;
     }
 
+    /**
+     * If this option is false then the aggregate method is not used if there was no data
to enrich.
+     * If this option is true then null values is used as the oldExchange (when no data to
enrich),
+     * when using POJOs as the AggregationStrategy.
+     */
     public void setAggregationStrategyMethodAllowNull(Boolean aggregationStrategyMethodAllowNull)
{
         this.aggregationStrategyMethodAllowNull = aggregationStrategyMethodAllowNull;
     }
@@ -189,6 +207,10 @@ public class EnrichDefinition extends NoOutputDefinition<EnrichDefinition>
imple
         return aggregationStrategy;
     }
 
+    /**
+     * Sets the AggregationStrategy to be used to merge the reply from the external service,
into a single outgoing message.
+     * By default Camel will use the reply from the external service as outgoing message.
+     */
     public void setAggregationStrategy(AggregationStrategy aggregationStrategy) {
         this.aggregationStrategy = aggregationStrategy;
     }
@@ -197,6 +219,12 @@ public class EnrichDefinition extends NoOutputDefinition<EnrichDefinition>
imple
         return aggregateOnException;
     }
 
+    /**
+     * If this option is false then the aggregate method is not used if there was an exception
thrown while trying
+     * to retrieve the data to enrich from the resource. Setting this option to true allows
end users to control what
+     * to do if there was an exception in the aggregate method. For example to suppress the
exception
+     * or set a custom message body etc.
+     */
     public void setAggregateOnException(Boolean aggregateOnException) {
         this.aggregateOnException = aggregateOnException;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/780c0964/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java
index ca24ed6..6f6a5f5 100644
--- a/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java
@@ -93,6 +93,10 @@ public class InterceptFromDefinition extends InterceptDefinition {
         return uri;
     }
 
+    /**
+     * Intercept incoming messages from the uri or uri pattern.
+     * If this option is not configured, then all incoming messages is intercepted.
+     */
     public void setUri(String uri) {
         this.uri = uri;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/780c0964/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java
index db433d0..4d1ef7e 100644
--- a/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java
@@ -17,7 +17,6 @@
 package org.apache.camel.model;
 
 import java.util.List;
-
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
@@ -210,6 +209,10 @@ public class InterceptSendToEndpointDefinition extends OutputDefinition<Intercep
         return skipSendToOriginalEndpoint;
     }
 
+    /**
+     * If set to true then the message is not sent to the original endpoint.
+     * By default (false) the message is both intercepted and then sent to the original endpoint.
+     */
     public void setSkipSendToOriginalEndpoint(Boolean skipSendToOriginalEndpoint) {
         this.skipSendToOriginalEndpoint = skipSendToOriginalEndpoint;
     }
@@ -222,6 +225,9 @@ public class InterceptSendToEndpointDefinition extends OutputDefinition<Intercep
         return uri;
     }
 
+    /**
+     * Intercept sending to the uri or uri pattern.
+     */
     public void setUri(String uri) {
         this.uri = uri;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/780c0964/camel-core/src/main/java/org/apache/camel/model/PackageScanDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/PackageScanDefinition.java b/camel-core/src/main/java/org/apache/camel/model/PackageScanDefinition.java
index c7f8293..b47c6d6 100644
--- a/camel-core/src/main/java/org/apache/camel/model/PackageScanDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/PackageScanDefinition.java
@@ -18,15 +18,17 @@ package org.apache.camel.model;
 
 import java.util.ArrayList;
 import java.util.List;
-
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.apache.camel.spi.Label;
+
 /**
  * Scans for Java {@link org.apache.camel.builder.RouteBuilder} classes in java packages
  */
+@Label("configuration")
 @XmlRootElement(name = "packageScan")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class PackageScanDefinition {

http://git-wip-us.apache.org/repos/asf/camel/blob/780c0964/camel-core/src/main/java/org/apache/camel/model/config/PropertyDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/config/PropertyDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/config/PropertyDefinition.java
index 81a754a..dcb8a6d 100644
--- a/camel-core/src/main/java/org/apache/camel/model/config/PropertyDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/config/PropertyDefinition.java
@@ -21,9 +21,12 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.apache.camel.spi.Label;
+
 /**
  * A key value pair
  */
+@Label("configuration")
 @XmlRootElement(name = "property")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class PropertyDefinition {


Mime
View raw message