Author: veithen
Date: Sat Jul 25 21:39:05 2009
New Revision: 797846
URL: http://svn.apache.org/viewvc?rev=797846&view=rev
Log:
Clarified some aspects of XMLFragmentStreamReader.
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLFragmentStreamReader.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLFragmentStreamReader.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLFragmentStreamReader.java?rev=797846&r1=797845&r2=797846&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLFragmentStreamReader.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLFragmentStreamReader.java
Sat Jul 25 21:39:05 2009
@@ -36,6 +36,7 @@
* <pre><a><b>text</b></a></pre>
* If the current event is <code><b></code> when the wrapper is created, it
will produce
* the following sequence of events:
+ * <p>
* <ul>
* <li>A synthetic START_DOCUMENT event.</li>
* <li>START_ELEMENT, CHARACTERS and END_ELEMENT events for
<code><b>text</b></code>.
@@ -45,6 +46,10 @@
* After all events have been consumed from the wrapper, the current event on
the parent reader
* will be the event following the last END_ELEMENT of the fragment. In the
example above this
* will be <code></a></code>.
+ * <p>
+ * The wrapper will release the reference to the parent reader when {...@link
#close()} is called.
+ * For obvious reasons, the wrapper will never call {...@link
XMLStreamReader#close()} on the parent
+ * reader.
*/
public class XMLFragmentStreamReader implements XMLStreamReader {
// The current event is a synthetic START_DOCUMENT event
@@ -59,7 +64,7 @@
// The current event is a synthetic END_DOCUMENT event
private static final int STATE_END_DOCUMENT = 3;
- private final XMLStreamReader parent;
+ private XMLStreamReader parent;
private int state;
private int depth;
@@ -147,8 +152,7 @@
}
public void close() throws XMLStreamException {
- // TODO: not sure if we should always allow this!
- parent.close();
+ parent = null;
}
public Object getProperty(String name) throws IllegalArgumentException {