You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2013/01/05 14:38:57 UTC
svn commit: r1429282 - in
/camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl:
DSL.scala SAbstractDefinition.scala builder/RouteBuilder.scala
Author: davsclaus
Date: Sat Jan 5 13:38:57 2013
New Revision: 1429282
URL: http://svn.apache.org/viewvc?rev=1429282&view=rev
Log:
CAMEL-5872: Added convertBodyTo to scala DSL to make it aligned with the other DSLs
Modified:
camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala
camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala
Modified: camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala?rev=1429282&r1=1429281&r2=1429282&view=diff
==============================================================================
--- camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala (original)
+++ camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala Sat Jan 5 13:38:57 2013
@@ -31,13 +31,13 @@ import org.apache.camel.spi.Policy
trait DSL {
def aggregate(expression: Exchange => Any, strategy: AggregationStrategy) : SAggregateDefinition
- def as[Target](toType: Class[Target]) : DSL
+ def as[Target](toType: Class[Target], charset: String = null) : DSL
def attempt : STryDefinition
def bean(bean: Any) : DSL
def choice : SChoiceDefinition
- def convertBodyTo[Target](toType: Class[Target]) : DSL
+ def convertBodyTo[Target](toType: Class[Target], charset: String = null) : DSL
def delay(delay: Period) : SDelayDefinition
def dynamicRouter(expression: Exchange => Any) : DSL
@@ -50,8 +50,8 @@ trait DSL {
def id(id : String): DSL
def idempotentConsumer(expression: Exchange => Any): SIdempotentConsumerDefinition
- def inOnly(): DSL with Block
- def inOut(): DSL with Block
+ def inOnly: DSL with Block
+ def inOut: DSL with Block
def loadbalance : SLoadBalanceDefinition
def log(message: String) : DSL
Modified: camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala?rev=1429282&r1=1429281&r2=1429282&view=diff
==============================================================================
--- camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala (original)
+++ camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala Sat Jan 5 13:38:57 2013
@@ -55,7 +55,7 @@ abstract class SAbstractDefinition[P <:
//-----------------------------------------------------------------
def aggregate(expression: Exchange => Any, strategy: AggregationStrategy) = SAggregateDefinition(target.aggregate(expression, strategy))
- def as[Target](toType: Class[Target]) = wrap(target.convertBodyTo(toType))
+ def as[Target](toType: Class[Target], charset: String = null) = wrap(target.convertBodyTo(toType, charset))
def attempt: STryDefinition = STryDefinition(target.doTry())
def bean(bean: Any) = bean match {
@@ -65,7 +65,7 @@ abstract class SAbstractDefinition[P <:
}
def choice = SChoiceDefinition(target.choice)
- def convertBodyTo[Target](toType: Class[Target]) = wrap(target.convertBodyTo(toType))
+ def convertBodyTo[Target](toType: Class[Target], charset: String = null) = wrap(target.convertBodyTo(toType, charset))
def delay(period: Period) = SDelayDefinition(target.delay(period.milliseconds))
def dynamicRouter(expression: Exchange => Any) = wrap(target.dynamicRouter(expression))
Modified: camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala?rev=1429282&r1=1429281&r2=1429282&view=diff
==============================================================================
--- camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala (original)
+++ camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala Sat Jan 5 13:38:57 2013
@@ -98,12 +98,12 @@ class RouteBuilder extends Preamble with
// EIPs
//-----------------------------------------------------------------
def aggregate(expression: Exchange => Any, strategy: AggregationStrategy) = stack.top.aggregate(expression, strategy)
- def as[Target](toType: Class[Target]) = stack.top.as(toType)
+ def as[Target](toType: Class[Target], charset: String = null) = stack.top.as(toType, charset)
def attempt = stack.top.attempt
def bean(bean: Any) = stack.top.bean(bean)
- def convertBodyTo[Target](toType: Class[Target]) = stack.top.convertBodyTo(toType)
+ def convertBodyTo[Target](toType: Class[Target], charset: String = null) = stack.top.convertBodyTo(toType, charset)
def choice = stack.top.choice
def delay(delay: Period) = stack.top.delay(delay)