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:39:55 UTC

svn commit: r1429283 - in /camel/branches/camel-2.10.x: ./ components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/ components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/

Author: davsclaus
Date: Sat Jan  5 13:39:55 2013
New Revision: 1429283

URL: http://svn.apache.org/viewvc?rev=1429283&view=rev
Log:
CAMEL-5872: Added convertBodyTo to scala DSL to make it aligned with the other DSLs

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala
    camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
    camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1429282

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala?rev=1429283&r1=1429282&r2=1429283&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala (original)
+++ camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala Sat Jan  5 13:39:55 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/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala?rev=1429283&r1=1429282&r2=1429283&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala (original)
+++ camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala Sat Jan  5 13:39:55 2013
@@ -56,7 +56,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 {
@@ -66,7 +66,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/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala?rev=1429283&r1=1429282&r2=1429283&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala (original)
+++ camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala Sat Jan  5 13:39:55 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)