camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r889209 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java
Date Thu, 10 Dec 2009 11:49:35 GMT
Author: ningjiang
Date: Thu Dec 10 11:49:29 2009
New Revision: 889209

URL: http://svn.apache.org/viewvc?rev=889209&view=rev
Log:
Fixed CS error of SimpleLanguage and EtlRoutes

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java
    camel/trunk/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java?rev=889209&r1=889208&r2=889209&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java
Thu Dec 10 11:49:29 2009
@@ -127,28 +127,9 @@
         // file: prefix
         remainder = ifStartsWithReturnRemainder("file:", expression);
         if (remainder != null) {
-            if (ObjectHelper.equal(remainder, "name")) {
-                return ExpressionBuilder.fileNameExpression();
-            } else if (ObjectHelper.equal(remainder, "name.noext")) {
-                return ExpressionBuilder.fileNameNoExtensionExpression();
-            } else if (ObjectHelper.equal(remainder, "onlyname")) {
-                return ExpressionBuilder.fileOnlyNameExpression();
-            } else if (ObjectHelper.equal(remainder, "onlyname.noext")) {
-                return ExpressionBuilder.fileOnlyNameNoExtensionExpression();
-            } else if (ObjectHelper.equal(remainder, "ext")) {
-                return ExpressionBuilder.fileExtensionExpression();
-            } else if (ObjectHelper.equal(remainder, "parent")) {
-                return ExpressionBuilder.fileParentExpression();
-            } else if (ObjectHelper.equal(remainder, "path")) {
-                return ExpressionBuilder.filePathExpression();
-            } else if (ObjectHelper.equal(remainder, "absolute")) {
-                return ExpressionBuilder.fileAbsoluteExpression();
-            } else if (ObjectHelper.equal(remainder, "absolute.path")) {
-                return ExpressionBuilder.fileAbsolutePathExpression();
-            } else if (ObjectHelper.equal(remainder, "length")) {
-                return ExpressionBuilder.fileSizeExpression();
-            } else if (ObjectHelper.equal(remainder, "modified")) {
-                return ExpressionBuilder.fileLastModifiedExpression();
+            Expression fileExpression = createSimpleFileExpression(remainder);
+            if (expression != null) {
+                return fileExpression;
             }
         }
 
@@ -176,6 +157,33 @@
             return ExpressionBuilder.constantExpression(expression);
         }
     }
+    
+    public Expression createSimpleFileExpression(String remainder) {
+        if (ObjectHelper.equal(remainder, "name")) {
+            return ExpressionBuilder.fileNameExpression();
+        } else if (ObjectHelper.equal(remainder, "name.noext")) {
+            return ExpressionBuilder.fileNameNoExtensionExpression();
+        } else if (ObjectHelper.equal(remainder, "onlyname")) {
+            return ExpressionBuilder.fileOnlyNameExpression();
+        } else if (ObjectHelper.equal(remainder, "onlyname.noext")) {
+            return ExpressionBuilder.fileOnlyNameNoExtensionExpression();
+        } else if (ObjectHelper.equal(remainder, "ext")) {
+            return ExpressionBuilder.fileExtensionExpression();
+        } else if (ObjectHelper.equal(remainder, "parent")) {
+            return ExpressionBuilder.fileParentExpression();
+        } else if (ObjectHelper.equal(remainder, "path")) {
+            return ExpressionBuilder.filePathExpression();
+        } else if (ObjectHelper.equal(remainder, "absolute")) {
+            return ExpressionBuilder.fileAbsoluteExpression();
+        } else if (ObjectHelper.equal(remainder, "absolute.path")) {
+            return ExpressionBuilder.fileAbsolutePathExpression();
+        } else if (ObjectHelper.equal(remainder, "length")) {
+            return ExpressionBuilder.fileSizeExpression();
+        } else if (ObjectHelper.equal(remainder, "modified")) {
+            return ExpressionBuilder.fileLastModifiedExpression();
+        }
+        return null;
+    }
 
     public boolean isSingleton() {
         return true;

Modified: camel/trunk/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java?rev=889209&r1=889208&r2=889209&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java
(original)
+++ camel/trunk/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java
Thu Dec 10 11:49:29 2009
@@ -18,8 +18,6 @@
 
 import org.apache.camel.Exchange;
 import org.apache.camel.spring.SpringRouteBuilder;
-import org.apache.camel.LoggingLevel;
-import org.apache.camel.processor.interceptor.Tracer;
 import static org.apache.camel.language.juel.JuelExpression.el;
 
 /**
@@ -28,15 +26,7 @@
 // START SNIPPET: example
 public class EtlRoutes extends SpringRouteBuilder {
     public void configure() throws Exception {
-	
-        /**
-	Tracer tracer = new Tracer();
-        tracer.setLogLevel(LoggingLevel.FATAL);
-        tracer.setLogName("org.apache.camel.example.etl");
-        tracer.setLogStackTrace(true);
-        tracer.setTraceExceptions(true);
-        **/
-	    
+
         from("file:src/data?noop=true")
             .convertBodyTo(PersonDocument.class)
             .to("jpa:org.apache.camel.example.etl.CustomerEntity");



Mime
View raw message