You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2007/04/25 17:41:28 UTC
svn commit: r532393 -
/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
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;
}