You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2012/08/11 12:41:47 UTC

svn commit: r1371910 - in /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder: SOAPBuilderHelper.java StAXSOAPModelBuilder.java

Author: veithen
Date: Sat Aug 11 10:41:46 2012
New Revision: 1371910

URL: http://svn.apache.org/viewvc?rev=1371910&view=rev
Log:
Duplicate code reduction: let SOAPBuilderHelper use the code in StAXBuilder to process attributes.

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/SOAPBuilderHelper.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/SOAPBuilderHelper.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/SOAPBuilderHelper.java?rev=1371910&r1=1371909&r2=1371910&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/SOAPBuilderHelper.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/SOAPBuilderHelper.java Sat Aug 11 10:41:46 2012
@@ -20,7 +20,6 @@
 package org.apache.axiom.soap.impl.builder;
 
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.soap.SOAPProcessingException;
 
 import javax.xml.stream.XMLStreamReader;
@@ -44,19 +43,6 @@ public abstract class SOAPBuilderHelper 
     }
 
     protected void processAttributes(OMElement node) {
-        int attribCount = parser.getAttributeCount();
-        for (int i = 0; i < attribCount; i++) {
-            OMNamespace ns = null;
-            String uri = parser.getAttributeNamespace(i);
-            if (uri != null && uri.hashCode() != 0) {
-                ns = node.findNamespace(uri,
-                                        parser.getAttributePrefix(i));
-            }
-
-            // todo if the attributes are supposed to namespace qualified all the time
-            // todo then this should throw an exception here
-            node.addAttribute(parser.getAttributeLocalName(i),
-                              parser.getAttributeValue(i), ns);
-        }
+        builder.processAttributes(node);
     }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java?rev=1371910&r1=1371909&r2=1371910&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java Sat Aug 11 10:41:46 2012
@@ -395,6 +395,11 @@ public class StAXSOAPModelBuilder extend
         super.processNamespaceData(node);
     }
 
+    // Necessary to allow SOAPBuilderHelper to access this method
+    protected void processAttributes(OMElement node) {
+        super.processAttributes(node);
+    }
+
 /*these three methods to set and check detail element processing or mandatory fault element are present
 */