ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1734621 - in /webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder: AbstractBuilder.java PushBuilder.java StAXOMBuilder.java
Date Fri, 11 Mar 2016 19:46:10 GMT
Author: veithen
Date: Fri Mar 11 19:46:09 2016
New Revision: 1734621

URL: http://svn.apache.org/viewvc?rev=1734621&view=rev
Log:
Unify some of the builder code.

Modified:
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractBuilder.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushBuilder.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractBuilder.java?rev=1734621&r1=1734620&r2=1734621&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractBuilder.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractBuilder.java
Fri Mar 11 19:46:09 2016
@@ -23,6 +23,7 @@ import org.apache.axiom.core.NodeFactory
 import org.apache.axiom.core.stream.NamespaceRepairingFilterHandler;
 import org.apache.axiom.core.stream.XmlHandler;
 import org.apache.axiom.om.OMDocument;
+import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.intf.AxiomDocument;
 import org.apache.axiom.om.impl.intf.AxiomSourcedElement;
@@ -51,4 +52,18 @@ public abstract class AbstractBuilder im
         }
         return document;
     }
+    
+    public final OMElement getDocumentElement() {
+        return getDocumentElement(false);
+    }
+
+    public final OMElement getDocumentElement(boolean discardDocument) {
+        OMDocument document = getDocument();
+        OMElement element = document.getOMDocumentElement();
+        if (discardDocument) {
+            element.detach();
+            ((AxiomDocument)document).coreDiscard(false);
+        }
+        return element;
+    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushBuilder.java?rev=1734621&r1=1734620&r2=1734621&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushBuilder.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushBuilder.java
Fri Mar 11 19:46:09 2016
@@ -23,7 +23,6 @@ import org.apache.axiom.core.stream.Stre
 import org.apache.axiom.core.stream.XmlInput;
 import org.apache.axiom.core.stream.XmlReader;
 import org.apache.axiom.om.DeferredParsingException;
-import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.impl.intf.AxiomSourcedElement;
 
@@ -45,18 +44,6 @@ public final class PushBuilder extends A
         }
     }
 
-    public final OMElement getDocumentElement() {
-        return getDocument().getOMDocumentElement();
-    }
-
-    public final OMElement getDocumentElement(boolean discardDocument) {
-        OMElement documentElement = getDocument().getOMDocumentElement();
-        if (discardDocument) {
-            documentElement.detach();
-        }
-        return documentElement;
-    }
-
     public final String getCharacterEncoding() {
         throw new UnsupportedOperationException();
     }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java?rev=1734621&r1=1734620&r2=1734621&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java
Fri Mar 11 19:46:09 2016
@@ -20,14 +20,11 @@
 package org.apache.axiom.om.impl.common.builder;
 
 import org.apache.axiom.core.NodeFactory;
-import org.apache.axiom.om.OMDocument;
-import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.ds.custombuilder.CustomBuilder;
 import org.apache.axiom.om.ds.custombuilder.CustomBuilderSupport;
 import org.apache.axiom.om.ds.custombuilder.CustomBuilder.Selector;
 import org.apache.axiom.om.impl.builder.Detachable;
-import org.apache.axiom.om.impl.intf.AxiomDocument;
 import org.apache.axiom.om.impl.intf.AxiomSourcedElement;
 
 import javax.xml.stream.XMLStreamReader;
@@ -122,18 +119,4 @@ public class StAXOMBuilder extends Abstr
         helper.next();
         builderHandler.executeDeferredActions();
     }
-    
-    public final OMElement getDocumentElement() {
-        return getDocumentElement(false);
-    }
-
-    public final OMElement getDocumentElement(boolean discardDocument) {
-        OMDocument document = getDocument();
-        OMElement element = document.getOMDocumentElement();
-        if (discardDocument) {
-            element.detach();
-            ((AxiomDocument)document).coreDiscard(false);
-        }
-        return element;
-    }
 }



Mime
View raw message