Repository: camel
Updated Branches:
  refs/heads/master ea258fb3f -> 775259dd5


CAMEL-8309: Camel XML DSL - Allow to specify uri attributes in multi lines to 
make long urs easier to read and maintain


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9681ac77
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9681ac77
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9681ac77

Branch: refs/heads/master
Commit: 9681ac7793ed76611f7e3b2e4c4d1ec9227e5a23
Parents: ea258fb
Author: Claus Ibsen <[email protected]>
Authored: Tue Feb 3 08:53:40 2015 +0100
Committer: Claus Ibsen <[email protected]>
Committed: Tue Feb 3 08:53:40 2015 +0100

----------------------------------------------------------------------
 .../apache/camel/blueprint/handler/CamelNamespaceHandler.java | 7 +++----
 .../apache/camel/spring/handler/CamelNamespaceHandler.java    | 6 +++---
 2 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9681ac77/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
----------------------------------------------------------------------
diff --git 
a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
 
b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
index c2e55fc..8d0a789 100644
--- 
a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
+++ 
b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
@@ -142,20 +142,19 @@ public class CamelNamespaceHandler implements 
NamespaceHandler {
                 doc.renameNode(node, toNamespace, node.getLocalName());
             }
 
-            // remove whitespace noise from uri attributes, eg new lines, and 
tabs etc, which allows end users to format
+            // remove whitespace noise from uri, xxxUri attributes, eg new 
lines, and tabs etc, which allows end users to format
             // their Camel routes in more human readable format, but at 
runtime those attributes must be trimmed
             // the parser removes most of the noise, but keeps double spaces 
in the attribute values
             NamedNodeMap map = node.getAttributes();
             for (int i = 0; i < map.getLength(); i++) {
                 Node att = map.item(i);
-                if ("uri".equals(att.getNodeName()) || 
"url".equals(att.getNodeName())) {
-
+                if (att.getNodeName().equals("uri") || 
att.getNodeName().endsWith("Uri")) {
                     String value = att.getNodeValue();
                     // remove all double spaces
                     String changed = value.replaceAll("\\s{2,}", "");
 
                     if (!value.equals(changed)) {
-                        LOG.debug("Removing whitespace noise from attribute {} 
-> {}", value, changed);
+                        LOG.debug("Removed whitespace noise from attribute {} 
-> {}", value, changed);
                         att.setNodeValue(changed);
                     }
                 }

http://git-wip-us.apache.org/repos/asf/camel/blob/9681ac77/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
----------------------------------------------------------------------
diff --git 
a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
 
b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
index ebb3893..2efbd89 100644
--- 
a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
+++ 
b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
@@ -92,20 +92,20 @@ public class CamelNamespaceHandler extends 
NamespaceHandlerSupport {
                 doc.renameNode(node, SPRING_NS, node.getNodeName());
             }
 
-            // remove whitespace noise from uri attributes, eg new lines, and 
tabs etc, which allows end users to format
+            // remove whitespace noise from uri, xxxUri attributes, eg new 
lines, and tabs etc, which allows end users to format
             // their Camel routes in more human readable format, but at 
runtime those attributes must be trimmed
             // the parser removes most of the noise, but keeps double spaces 
in the attribute values
             NamedNodeMap map = node.getAttributes();
             for (int i = 0; i < map.getLength(); i++) {
                 Node att = map.item(i);
-                if ("uri".equals(att.getNodeName()) || 
"url".equals(att.getNodeName())) {
+                if (att.getNodeName().equals("uri") || 
att.getNodeName().endsWith("Uri")) {
 
                     String value = att.getNodeValue();
                     // remove all double spaces
                     String changed = value.replaceAll("\\s{2,}", "");
 
                     if (!value.equals(changed)) {
-                        LOG.debug("Removing whitespace noise from attribute {} 
-> {}", value, changed);
+                        LOG.debug("Removed whitespace noise from attribute {} 
-> {}", value, changed);
                         att.setNodeValue(changed);
                     }
                 }

Reply via email to