camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r958502 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/builder/ camel-core/src/main/java/org/apache/camel/util/ camel-core/src/test/java/org/apache/camel/component/bean/ camel-core/src/test/java/org/apache/camel/view/ componen...
Date Mon, 28 Jun 2010 08:36:01 GMT
Author: ningjiang
Date: Mon Jun 28 08:36:00 2010
New Revision: 958502

URL: http://svn.apache.org/viewvc?rev=958502&view=rev
Log:
CAMEL-2865 added xpath DSL for the RouteBuilder, fixed the build error

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/Builder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanProxyTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/view/DotViewTest.java
    camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpClientRouteTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/Builder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/Builder.java?rev=958502&r1=958501&r2=958502&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/Builder.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/Builder.java Mon Jun 28
08:36:00 2010
@@ -97,14 +97,6 @@ public final class Builder {
     }
     
     /**
-     * Returns a xpath expression
-     */
-    public static ValueBuilder xpath(String value) {
-        Expression expression = ExpressionBuilder.xpathExpression(value);
-        return new ValueBuilder(expression);
-    }
-
-    /**
      * Returns a predicate and value builder for headers on an exchange
      */
     public static ValueBuilder header(String name) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java?rev=958502&r1=958501&r2=958502&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java Mon
Jun 28 08:36:00 2010
@@ -25,6 +25,7 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.Expression;
 import org.apache.camel.LoggingLevel;
 import org.apache.camel.NoSuchEndpointException;
+import org.apache.camel.builder.xml.XPathBuilder;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -138,8 +139,8 @@ public abstract class BuilderSupport {
     /**
      * Returns a xpath expression value builder
      */
-    public ValueBuilder xpath(String value) {
-        return Builder.xpath(value);
+    public XPathBuilder xpath(String value) {
+        return XPathBuilder.xpath(value);
     }
 
     /**

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java?rev=958502&r1=958501&r2=958502&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java Mon
Jun 28 08:36:00 2010
@@ -1105,24 +1105,7 @@ public final class ExpressionBuilder {
             }
         };
     }
-    
-    public static Expression xpathExpression(final String expression) {
-        return new ExpressionAdapter() {
-            public Object evaluate(Exchange exchange) {
-                // resolve language using context to have a clear separation of packages
-                // must call evaluate to return the nested language evaluate when evaluating
-                // stacked expressions
-                Language language = exchange.getContext().resolveLanguage("xpath");
-                return language.createExpression(expression).evaluate(exchange, Object.class);
-            }
-
-            @Override
-            public String toString() {
-                return "xpath(" + expression + ")";
-            }
-        };
-    }
-
+   
     public static Expression beanExpression(final String expression) {
         return new ExpressionAdapter() {
             public Object evaluate(Exchange exchange) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java?rev=958502&r1=958501&r2=958502&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java Mon Jun
28 08:36:00 2010
@@ -356,7 +356,7 @@ public final class EndpointHelper {
         List<Route> routes = endpoint.getCamelContext().getRoutes();
         for (Route route : routes) {
             if (route.getEndpoint().equals(endpoint)
-                    || route.getEndpoint().getEndpointKey().equals(endpoint.getEndpointKey())
) {
+                    || route.getEndpoint().getEndpointKey().equals(endpoint.getEndpointKey()))
{
                 return route.getId();
             }
         }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanProxyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanProxyTest.java?rev=958502&r1=958501&r2=958502&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanProxyTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanProxyTest.java
Mon Jun 28 08:36:00 2010
@@ -23,7 +23,7 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.InvalidPayloadException;
 import org.apache.camel.builder.ProxyBuilder;
 import org.apache.camel.builder.RouteBuilder;
-import static org.apache.camel.builder.xml.XPathBuilder.xpath;
+
 
 /**
  * @version $Revision$

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/view/DotViewTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/view/DotViewTest.java?rev=958502&r1=958501&r2=958502&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/view/DotViewTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/view/DotViewTest.java Mon Jun 28
08:36:00 2010
@@ -21,7 +21,6 @@ import org.apache.camel.builder.RouteBui
 import org.apache.camel.builder.xml.XPathBuilder;
 import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy;
 
-import static org.apache.camel.builder.xml.XPathBuilder.xpath;
 
 /**
  * @version $Revision$

Modified: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpClientRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpClientRouteTest.java?rev=958502&r1=958501&r2=958502&view=diff
==============================================================================
--- camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpClientRouteTest.java
(original)
+++ camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpClientRouteTest.java
Mon Jun 28 08:36:00 2010
@@ -125,6 +125,7 @@ public class HttpClientRouteTest extends
                 from("jetty:http://localhost:9081/querystring").process(new Processor() {
 
                     public void process(Exchange exchange) throws Exception {
+                        
                         String result = exchange.getIn().getHeader("id", String.class);
                         if (result == null) {
                             result = "No id header";



Mime
View raw message