org.n52.security.common.xml
Class XMLChunkIterator
java.lang.Object
org.n52.security.common.xml.XMLChunkIterator
- All Implemented Interfaces:
- Iterator<XMLChunk>
public class XMLChunkIterator
- extends Object
- implements Iterator<XMLChunk>
Iterates over chunks of xml.
Because this iterator supports nested chunks, each chunk is returned twice.
First a "start" chunk, if the start element of a chunk is seen.
Second a "end" chunk, if the end element of a chunk is seen, only here the content is given.
If a chunk contains nested chunks, then the content of the nested chunks is not embedded in the "parent" chunk.
When an element is a start/end of a chunk is open to XMLChunkIterator.QNameMatcher
implementations. The default way is to specify
element QNames.
Please note that the iterator updates the content of the Parent-Chunks if a nested chunk is visited.
Simple use the XMLChunk.getParent()
method to get an updated parent.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLChunkIterator
public XMLChunkIterator(InputSource source,
Iterable<org.n52.security.common.xml.XMLChunkIterator.Matcher> elementMatcher)
XMLChunkIterator
public XMLChunkIterator(InputSource source,
org.n52.security.common.xml.XMLChunkIterator.Matcher... elementMatcher)
XMLChunkIterator
public XMLChunkIterator(InputSource source,
QName... chunkStartElements)
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<XMLChunk>
next
public XMLChunk next()
- Specified by:
next
in interface Iterator<XMLChunk>
remove
public void remove()
- Specified by:
remove
in interface Iterator<XMLChunk>
Copyright © 2004–2014 52north.org. All rights reserved.