You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Claus Ibsen <ci...@silverbullet.dk> on 2008/10/27 14:53:24 UTC

RE: svn commit: r708107 - in /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model: ConvertBodyType.java ProcessorType.java

Hi

To be 100% covered shouldn't the setter for type class
    public void setTypeClass(Class typeClass) {
        this.typeClass = typeClass;
    }

Also not set the type? So the toString works?

So it should be?

    public void setTypeClass(Class typeClass) {
        this.typeClass = typeClass;
        setType(typeClass.getName());
    }

Even though I doubt that anyone will invoke the setter when they can use the fluent builder.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: ningjiang@apache.org [mailto:ningjiang@apache.org] 
Sent: 27. oktober 2008 09:45
To: camel-commits@activemq.apache.org
Subject: svn commit: r708107 - in /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model: ConvertBodyType.java ProcessorType.java

Author: ningjiang
Date: Mon Oct 27 01:44:48 2008
New Revision: 708107

URL: http://svn.apache.org/viewvc?rev=708107&view=rev
Log:
CAMEL-1027 Fixed the ConvertBodyType toString issue, and added a convertBodyTo(String) method to the ProcessorType

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyType.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyType.java?rev=708107&r1=708106&r2=708107&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyType.java Mon Oct 27 01:44:48 2008
@@ -51,10 +51,11 @@
 
     public ConvertBodyType(Class typeClass) {
         setTypeClass(typeClass);
+        setType(typeClass.getName());
     }
 
     @Override
-    public String toString() {
+    public String toString() {        
         return "convertBodyTo[" + getType() + "]";
     }
 

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java?rev=708107&r1=708106&r2=708107&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java Mon Oct 27 01:44:48 2008
@@ -1373,6 +1373,14 @@
         addOutput(new ConvertBodyType(type));
         return (Type) this;
     }
+    
+    /**
+     * Converts the IN message body to the specified class type
+     */
+    public Type convertBodyTo(String typeString) {
+        addOutput(new ConvertBodyType(typeString));
+        return (Type) this;
+    }
 
     /**
      * Converts the OUT message body to the specified type