activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r532393 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
Date Wed, 25 Apr 2007 15:41:28 GMT
Author: jstrachan
Date: Wed Apr 25 08:41:27 2007
New Revision: 532393

URL: http://svn.apache.org/viewvc?view=rev&rev=532393
Log:
added from("foo").convertBodyTo(Source.class).to("someXmlThingy") type methods

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java?view=diff&rev=532393&r1=532392&r2=532393
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
Wed Apr 25 08:41:27 2007
@@ -244,7 +244,7 @@
     }
     
     /**
-     * Trace logs the exchange before it goes to the next processing step using the {@link
DEFAULT_TRACE_CATEGORY} logging
+     * Trace logs the exchange before it goes to the next processing step using the {@link
#DEFAULT_TRACE_CATEGORY} logging
      * category.
      * 
      * @return
@@ -351,6 +351,25 @@
     @Fluent
     public FromBuilder<E> setProperty(String name, Expression<E> expression)
{
         addProcessorBuilder(ProcessorBuilder.setProperty(name, expression));
+        return this;
+    }
+
+
+    /**
+     * Converts the IN message body to the specified type
+     */
+    @Fluent
+    public FromBuilder<E> convertBodyTo(Class type) {
+        addProcessorBuilder(ProcessorBuilder.<E>setBody(Builder.<E>body().convertTo(type)));
+        return this;
+    }
+
+    /**
+     * Converts the OUT message body to the specified type
+     */
+    @Fluent
+    public FromBuilder<E> convertOutBodyTo(Class type) {
+        addProcessorBuilder(ProcessorBuilder.<E>setOutBody(Builder.<E>outBody().convertTo(type)));
         return this;
     }
 



Mime
View raw message