ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1733700 - in /webservices/axiom/branches/stax-stream/aspects: core-aspects/src/main/java/org/apache/axiom/core/impl/ core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/ om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/
Date Sat, 05 Mar 2016 11:20:44 GMT
Author: veithen
Date: Sat Mar  5 11:20:43 2016
New Revision: 1733700

URL: http://svn.apache.org/viewvc?rev=1733700&view=rev
Log:
Make sure that getXMLStreamReader works correctly with push OMDataSources.

Modified:
    webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/TreeWalkerImpl.java
    webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareElementSupport.aj
    webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/CoreParentNodeSupport.aj
    webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj
    webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj

Modified: webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/TreeWalkerImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/TreeWalkerImpl.java?rev=1733700&r1=1733699&r2=1733700&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/TreeWalkerImpl.java
(original)
+++ webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/TreeWalkerImpl.java
Sat Mar  5 11:20:43 2016
@@ -80,6 +80,7 @@ public final class TreeWalkerImpl implem
     private final XmlHandler handler;
     private final CoreParentNode root;
     private final boolean preserve;
+    private final boolean incremental;
     private CoreNode node;
     
     /**
@@ -90,10 +91,11 @@ public final class TreeWalkerImpl implem
     
     private int state = STATE_NONE;
     
-    public TreeWalkerImpl(XmlHandler handler, CoreParentNode root, boolean preserve) {
+    public TreeWalkerImpl(XmlHandler handler, CoreParentNode root, boolean preserve, boolean
incremental) {
         this.handler = handler;
         this.root = root;
         this.preserve = preserve;
+        this.incremental = incremental;
     }
     
     @Override
@@ -207,7 +209,7 @@ public final class TreeWalkerImpl implem
             // been visited yet. It may be a sourced element or a leaf node
             if (state == STATE_NOT_VISITED) {
                 if (nextNode instanceof CoreNSAwareElement) {
-                    XmlInput input = ((CoreNSAwareElement)nextNode).getXmlInput(preserve);
+                    XmlInput input = ((CoreNSAwareElement)nextNode).getXmlInput(preserve,
incremental);
                     if (input != null) {
                         reader = input.createReader(new DocumentElementExtractingFilterHandler(handler));
                         state = STATE_STREAMING;

Modified: webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareElementSupport.aj?rev=1733700&r1=1733699&r2=1733700&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareElementSupport.aj
(original)
+++ webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareElementSupport.aj
Sat Mar  5 11:20:43 2016
@@ -38,7 +38,7 @@ public aspect CoreNSAwareElementSupport
         return namespaceURI.equals(coreGetNamespaceURI()) ? coreGetPrefix() : null;
     }
     
-    public XmlInput CoreNSAwareElement.getXmlInput(boolean cache) throws StreamException
{
+    public XmlInput CoreNSAwareElement.getXmlInput(boolean cache, boolean incremental) throws
StreamException {
         return null;
     }
     

Modified: webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/CoreParentNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/CoreParentNodeSupport.aj?rev=1733700&r1=1733699&r2=1733700&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/CoreParentNodeSupport.aj
(original)
+++ webservices/axiom/branches/stax-stream/aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/CoreParentNodeSupport.aj
Sat Mar  5 11:20:43 2016
@@ -371,13 +371,13 @@ public aspect CoreParentNodeSupport {
         throw new UnsupportedOperationException();
     }
 
-    public final XmlReader CoreParentNode.coreGetReader(XmlHandler handler, boolean cache)
{
-        return new TreeWalkerImpl(handler, this, cache);
+    public final XmlReader CoreParentNode.coreGetReader(XmlHandler handler, boolean cache,
boolean incremental) {
+        return new TreeWalkerImpl(handler, this, cache, incremental);
     }
     
     public void CoreParentNode.internalSerialize(XmlHandler handler, boolean cache) throws
CoreModelException, StreamException {
         try {
-            XmlReader reader = coreGetReader(handler, cache);
+            XmlReader reader = coreGetReader(handler, cache, false);
             while (!reader.proceed()) {
                 // Just loop
             }

Modified: webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj?rev=1733700&r1=1733699&r2=1733700&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj
(original)
+++ webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj
Sat Mar  5 11:20:43 2016
@@ -141,7 +141,7 @@ public aspect AxiomContainerSupport {
             }
         }
         try {
-            pivot.setReader(coreGetReader(handler, cache));
+            pivot.setReader(coreGetReader(handler, cache, true));
         } catch (StreamException ex) {
             throw new OMException(ex);
         }

Modified: webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj?rev=1733700&r1=1733699&r2=1733700&view=diff
==============================================================================
--- webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
(original)
+++ webservices/axiom/branches/stax-stream/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
Sat Mar  5 11:20:43 2016
@@ -403,7 +403,7 @@ public aspect AxiomSourcedElementSupport
         }
     }
 
-    public final XmlInput AxiomSourcedElement.getXmlInput(boolean cache) throws StreamException
{
+    public final XmlInput AxiomSourcedElement.getXmlInput(boolean cache, boolean incremental)
throws StreamException {
         if (isExpanded() || (cache && OMDataSourceUtil.isDestructiveWrite(dataSource)))
{
             return null;
         }
@@ -415,8 +415,10 @@ public aspect AxiomSourcedElementSupport
             } catch (XMLStreamException ex) {
                 throw new StreamException(ex);
             }
-        } else {
+        } else if (!incremental) {
             return new PushOMDataSourceInput(this, dataSource);
+        } else {
+            return null;
         }
     }
 



Mime
View raw message