camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r724665 - in /activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model: RemoveHeaderType.java RemovePropertyType.java SetOutHeaderType.java SetPropertyType.java
Date Tue, 09 Dec 2008 11:40:31 GMT
Author: davsclaus
Date: Tue Dec  9 03:40:30 2008
New Revision: 724665

URL: http://svn.apache.org/viewvc?rev=724665&view=rev
Log:
CAMEL-1160: name attribute should be required.

Modified:
    activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/RemoveHeaderType.java
    activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/RemovePropertyType.java
    activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java
    activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/SetPropertyType.java

Modified: activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/RemoveHeaderType.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/RemoveHeaderType.java?rev=724665&r1=724664&r2=724665&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/RemoveHeaderType.java
(original)
+++ activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/RemoveHeaderType.java
Tue Dec  9 03:40:30 2008
@@ -24,6 +24,7 @@
 import org.apache.camel.Processor;
 import org.apache.camel.builder.ProcessorBuilder;
 import org.apache.camel.spi.RouteContext;
+import org.apache.camel.util.ObjectHelper;
 
 /**
  * Represents an XML <removeHeader/> element
@@ -31,7 +32,7 @@
 @XmlRootElement(name = "removeHeader")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class RemoveHeaderType extends OutputType<ProcessorType> {
-    @XmlAttribute
+    @XmlAttribute(required = true)
     private String headerName;   
     
     public RemoveHeaderType() {
@@ -53,6 +54,7 @@
 
     @Override
     public Processor createProcessor(RouteContext routeContext) throws Exception {      
 
+        ObjectHelper.notNull(getHeaderName(), "headerName");
         return ProcessorBuilder.removeHeader(getHeaderName());
     }
 

Modified: activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/RemovePropertyType.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/RemovePropertyType.java?rev=724665&r1=724664&r2=724665&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/RemovePropertyType.java
(original)
+++ activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/RemovePropertyType.java
Tue Dec  9 03:40:30 2008
@@ -24,6 +24,7 @@
 import org.apache.camel.Processor;
 import org.apache.camel.builder.ProcessorBuilder;
 import org.apache.camel.spi.RouteContext;
+import org.apache.camel.util.ObjectHelper;
 
 /**
  * Represents an XML &lt;removeProperty/&gt; element
@@ -31,7 +32,7 @@
 @XmlRootElement(name = "removeProperty")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class RemovePropertyType extends OutputType<ProcessorType> {
-    @XmlAttribute
+    @XmlAttribute(required = true)
     private String propertyName;   
     
     public RemovePropertyType() {
@@ -53,6 +54,7 @@
 
     @Override
     public Processor createProcessor(RouteContext routeContext) throws Exception {      
 
+        ObjectHelper.notNull(getPropertyName(), "propertyName");
         return ProcessorBuilder.removeProperty(getPropertyName());
     }
 

Modified: activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java?rev=724665&r1=724664&r2=724665&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java
(original)
+++ activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java
Tue Dec  9 03:40:30 2008
@@ -26,6 +26,7 @@
 import org.apache.camel.builder.ProcessorBuilder;
 import org.apache.camel.model.language.ExpressionType;
 import org.apache.camel.spi.RouteContext;
+import org.apache.camel.util.ObjectHelper;
 
 /**
  * Represents an XML &lt;setOutHeader/&gt; element
@@ -33,7 +34,7 @@
 @XmlRootElement(name = "setOutHeader")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class SetOutHeaderType extends ExpressionNode {
-    @XmlAttribute
+    @XmlAttribute(required = true)
     private String headerName;
     
     public SetOutHeaderType() {
@@ -61,6 +62,7 @@
 
     @Override
     public Processor createProcessor(RouteContext routeContext) throws Exception {
+        ObjectHelper.notNull(getHeaderName(), "headerName");
         Expression expr = getExpression().createExpression(routeContext);
         return ProcessorBuilder.setOutHeader(getHeaderName(), expr);
     }

Modified: activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/SetPropertyType.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/SetPropertyType.java?rev=724665&r1=724664&r2=724665&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/SetPropertyType.java
(original)
+++ activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/model/SetPropertyType.java
Tue Dec  9 03:40:30 2008
@@ -27,6 +27,7 @@
 import org.apache.camel.builder.ProcessorBuilder;
 import org.apache.camel.model.language.ExpressionType;
 import org.apache.camel.spi.RouteContext;
+import org.apache.camel.util.ObjectHelper;
 
 /**
  * Represents an XML &lt;setProperty/&gt; element
@@ -34,7 +35,7 @@
 @XmlRootElement(name = "setProperty")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class SetPropertyType extends ExpressionNode {
-    @XmlAttribute
+    @XmlAttribute(required = true)
     private String propertyName;
     
     public SetPropertyType() {
@@ -67,6 +68,7 @@
 
     @Override
     public Processor createProcessor(RouteContext routeContext) throws Exception {
+        ObjectHelper.notNull(getPropertyName(), "propertyName");
         Expression expr = getExpression().createExpression(routeContext);
         return ProcessorBuilder.setProperty(getPropertyName(), expr);
     }



Mime
View raw message