ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1728853 - in /webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common: builder/ factory/
Date Sat, 06 Feb 2016 15:49:28 GMT
Author: veithen
Date: Sat Feb  6 15:49:28 2016
New Revision: 1728853

URL: http://svn.apache.org/viewvc?rev=1728853&view=rev
Log:
Unify end of document handling.

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/AbstractPushBuilder.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.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=1728853&r1=1728852&r2=1728853&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
Sat Feb  6 15:49:28 2016
@@ -35,6 +35,10 @@ public abstract class AbstractBuilder im
         handler.addNodePostProcessor(nodePostProcessor);
     }
 
+    public final boolean isCompleted() {
+        return handler.isCompleted();
+    }
+
     public final OMDocument getDocument() {
         AxiomDocument document;
         while ((document = handler.getDocument()) == null) {

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractPushBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractPushBuilder.java?rev=1728853&r1=1728852&r2=1728853&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractPushBuilder.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractPushBuilder.java
Sat Feb  6 15:49:28 2016
@@ -44,10 +44,6 @@ public abstract class AbstractPushBuilde
         throw new UnsupportedOperationException();
     }
 
-    public final boolean isCompleted() {
-        return handler.document != null && handler.document.isComplete();
-    }
-
     public final OMElement getDocumentElement() {
         return getDocument().getOMDocumentElement();
     }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java?rev=1728853&r1=1728852&r2=1728853&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java
Sat Feb  6 15:49:28 2016
@@ -95,6 +95,10 @@ public final class BuilderHandler {
         }
     }
 
+    public boolean isCompleted() {
+        return done;
+    }
+    
     public AxiomDocument getDocument() {
         if (root != null) {
             throw new UnsupportedOperationException("There is no document linked to this
builder");
@@ -203,4 +207,15 @@ public final class BuilderHandler {
         node.coreSetReplacementText(replacementText);
         addChild(node);
     }
+    
+    public void endDocument() {
+        if (elementLevel != 0) {
+            throw new IllegalStateException();
+        }
+        if (document != null) {
+            document.setComplete(true);
+        }
+        target = null;
+        done = true;
+    }
 }

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=1728853&r1=1728852&r2=1728853&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
Sat Feb  6 15:49:28 2016
@@ -436,15 +436,6 @@ public class StAXOMBuilder extends Abstr
         handler.cache = true;
     }
 
-    /**
-     * Method isCompleted.
-     *
-     * @return Returns boolean.
-     */
-    public final boolean isCompleted() {
-        return handler.done;
-    }
-
     public final CustomBuilder registerCustomBuilder(QName qName, int maxDepth, CustomBuilder
customBuilder) {
         CustomBuilder old = null;
         if (customBuilders == null) {
@@ -568,9 +559,7 @@ public class StAXOMBuilder extends Abstr
                     handler.endElement();
                     break;
                 case XMLStreamConstants.END_DOCUMENT:
-                    handler.done = true;
-                    ((AxiomContainer) this.handler.document).setComplete(true);
-                    handler.target = null;
+                    handler.endDocument();
                     break;
                 case XMLStreamConstants.COMMENT:
                     handler.createComment(parser.getText());

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java?rev=1728853&r1=1728852&r2=1728853&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java
Sat Feb  6 15:49:28 2016
@@ -27,7 +27,6 @@ import org.apache.axiom.om.impl.common.O
 import org.apache.axiom.om.impl.common.builder.AbstractPushBuilder;
 import org.apache.axiom.om.impl.common.builder.BuilderUtil;
 import org.apache.axiom.om.impl.common.builder.Model;
-import org.apache.axiom.om.impl.intf.AxiomContainer;
 import org.apache.axiom.om.impl.intf.AxiomElement;
 import org.xml.sax.SAXException;
 import org.xml.sax.XMLReader;
@@ -52,11 +51,7 @@ public final class SAXOMBuilder extends
     }
 
     public void doEndDocument() {
-        if (handler.target != handler.document) {
-            throw new IllegalStateException();
-        }
-        handler.target = null;
-        ((AxiomContainer)handler.document).setComplete(true);
+        handler.endDocument();
     }
 
     public int next() {



Mime
View raw message