cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r774823 - /cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
Date Thu, 14 May 2009 15:29:39 GMT
Author: dkulp
Date: Thu May 14 15:29:39 2009
New Revision: 774823

URL: http://svn.apache.org/viewvc?rev=774823&view=rev
Log:
Fix compile failure

Modified:
    cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java

Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java?rev=774823&r1=774822&r2=774823&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
(original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
Thu May 14 15:29:39 2009
@@ -76,16 +76,18 @@
             this.parent = parent;
             this.currentChild = ch;
         }
-        public ElementFrame(T doc) {
+        public ElementFrame(T doc, boolean s) {
             this.element = doc;
             parent = null;
-            started = true;
+            started = s;
             attributes = Collections.emptyList();
             prefixes = Collections.emptyList();
             uris = Collections.emptyList();
             allAttributes = Collections.emptyList();
         }
-        
+        public ElementFrame(T doc) {
+            this(doc, true);
+        }        
         public T getElement() {
             return element;
         }
@@ -96,7 +98,12 @@
         public void setCurrentChild(I o) {
             currentChild = o;
         }
-
+        public boolean isDocument() {
+            return false;
+        }
+        public boolean isDocumentFragment() {
+            return false;
+        }
     }
 
     /**
@@ -138,7 +145,7 @@
 
         if (!frame.started) {
             frame.started = true;
-            currentEvent = START_ELEMENT;
+            currentEvent = frame.isDocument() ? START_DOCUMENT : START_ELEMENT;
         } else if (frame.currentAttribute < getAttributeCount() - 1) {
             frame.currentAttribute++;
             currentEvent = ATTRIBUTE;
@@ -159,8 +166,12 @@
             }
         } else {
             frame.ended = true;
-            currentEvent = END_ELEMENT;
-            endElement();
+            if (frame.isDocument()) {
+                currentEvent = END_DOCUMENT;                
+            } else {
+                currentEvent = END_ELEMENT;
+                endElement();
+            }
         }
         return currentEvent;
     }
@@ -224,7 +235,8 @@
      * @see javax.xml.stream.XMLStreamReader#hasNext()
      */
     public boolean hasNext() throws XMLStreamException {
-        return !(frames.size() == 0 && frame.ended);
+        
+        return !(frame.ended && (frames.size() == 0 || frame.isDocumentFragment()));
 
     }
 



Mime
View raw message