camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1411130 - in /camel/branches/camel-2.10.x: ./ components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/languages/Languages.scala components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/SplitterTokenizeXMLTest.scala
Date Mon, 19 Nov 2012 11:29:04 GMT
Author: davsclaus
Date: Mon Nov 19 11:29:03 2012
New Revision: 1411130

URL: http://svn.apache.org/viewvc?rev=1411130&view=rev
Log:
CAMEL-5803: Added tokenizeXML to Scala DSL to make it easy to use it as it is in Java DSL.

Added:
    camel/branches/camel-2.10.x/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/SplitterTokenizeXMLTest.scala
      - copied unchanged from r1411129, camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/SplitterTokenizeXMLTest.scala
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/languages/Languages.scala

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

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/languages/Languages.scala
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/languages/Languages.scala?rev=1411130&r1=1411129&r2=1411130&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/languages/Languages.scala
(original)
+++ camel/branches/camel-2.10.x/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/languages/Languages.scala
Mon Nov 19 11:29:03 2012
@@ -17,6 +17,8 @@
 package org.apache.camel
 package scala.dsl.languages
 
+import language.tokenizer.TokenizeLanguage
+
 /**
  * Trait to support the different expression languages available in Camel 
  */
@@ -42,6 +44,8 @@ trait Languages {
     def sql(expression: String) =        Languages.this.sql(expression)(exchange)
     def xpath(expression: String) =      Languages.this.xpath(expression)(exchange)
     def xquery(expression: String) =     Languages.this.xquery(expression)(exchange)
+
+    def tokenizeXML(tagName: String, inheritNamespaceTagName : String = null) = Languages.this.tokenizeXML(tagName,
inheritNamespaceTagName)(exchange)
   }
   
   // a set of methods to allow direct use of the language as an expression
@@ -62,6 +66,10 @@ trait Languages {
   def xpath(expression: String)(exchange: Exchange) =      Languages.evaluate(expression)(exchange)("xpath")
   def xquery(expression: String)(exchange: Exchange) =     Languages.evaluate(expression)(exchange)("xquery")
   
+  def tokenizeXML(tagName: String, inheritNamespaceTagName : String = null)(exchange : Exchange)
: Any = {
+    TokenizeLanguage.tokenizeXML(tagName, inheritNamespaceTagName).evaluate(exchange, classOf[Object])
+  }
+
 }
 
 /**



Mime
View raw message