camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r601289 - in /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml: Namespaces.java XPathBuilder.java
Date Wed, 05 Dec 2007 10:52:07 GMT
Author: jstrachan
Date: Wed Dec  5 02:52:06 2007
New Revision: 601289

URL: http://svn.apache.org/viewvc?rev=601289&view=rev
Log:
applied patch for https://issues.apache.org/activemq/browse/CAMEL-256 from Roman Kalukiewicz
with thanks!

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/Namespaces.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/Namespaces.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/Namespaces.java?rev=601289&r1=601288&r2=601289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/Namespaces.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/Namespaces.java
Wed Dec  5 02:52:06 2007
@@ -102,6 +102,15 @@
     }
 
     /**
+     * Creates the XPath expression using the current namespace context
+     */
+    public XPathExpression xpath(String expression, Class<?> resultType) {
+        XPathExpression answer = xpath(expression);
+        answer.setResultType(resultType);
+        return answer;
+    }
+
+    /**
      * Creates the XQuery expression using the current namespace context
      */
     public XQueryExpression xquery(String expression) {
@@ -114,9 +123,9 @@
      * Creates the XQuery expression using the current namespace context
      * and the given expected return type
      */
-    public XQueryExpression xquery(String expression, Class<?> returnType) {
+    public XQueryExpression xquery(String expression, Class<?> resultType) {
         XQueryExpression answer = new XQueryExpression(expression);
-        answer.setResultType(returnType);
+        answer.setResultType(resultType);
         configure(answer);
         return answer;
     }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java?rev=601289&r1=601288&r2=601289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java
Wed Dec  5 02:52:06 2007
@@ -195,6 +195,19 @@
     }
 
     /**
+     * Registers namespaces with the builder so that the registered
+     * prefixes can be used in XPath expressions
+     * 
+     * @param namespaces is namespaces object that should be used in the
+     *                      XPath expression
+     * @return the current builder
+     */
+    public XPathBuilder<E> namespaces(Namespaces namespaces) {
+        namespaces.configure(this);
+        return this;
+    }
+    
+    /**
      * Registers a variable (in the global namespace) which can be referred to
      * from XPath expressions
      */



Mime
View raw message