com.ctc.wstx.evt
Class FilteredEventReader
java.lang.Object
com.ctc.wstx.evt.FilteredEventReader
- All Implemented Interfaces:
- java.util.Iterator, javax.xml.stream.XMLEventReader, javax.xml.stream.XMLStreamConstants
public class FilteredEventReader
- extends java.lang.Object
- implements javax.xml.stream.XMLEventReader, javax.xml.stream.XMLStreamConstants
Some notes about implemention:
- There is no way to filter out values of peek(), so we'll just straight
dispatch the call to underlying reader
Fields inherited from interface javax.xml.stream.XMLStreamConstants |
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT |
Constructor Summary |
FilteredEventReader(javax.xml.stream.XMLEventReader r,
javax.xml.stream.EventFilter f)
|
Method Summary |
void |
close()
|
java.lang.String |
getElementText()
|
java.lang.Object |
getProperty(java.lang.String name)
|
boolean |
hasNext()
|
java.lang.Object |
next()
|
javax.xml.stream.events.XMLEvent |
nextEvent()
|
javax.xml.stream.events.XMLEvent |
nextTag()
|
javax.xml.stream.events.XMLEvent |
peek()
This is bit tricky to implement, but it should filter out
events just as nextEvent() would. |
void |
remove()
Note: only here because we implement Iterator interface |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FilteredEventReader
public FilteredEventReader(javax.xml.stream.XMLEventReader r,
javax.xml.stream.EventFilter f)
close
public void close()
throws javax.xml.stream.XMLStreamException
- Specified by:
close
in interface javax.xml.stream.XMLEventReader
- Throws:
javax.xml.stream.XMLStreamException
getElementText
public java.lang.String getElementText()
throws javax.xml.stream.XMLStreamException
- Specified by:
getElementText
in interface javax.xml.stream.XMLEventReader
- Throws:
javax.xml.stream.XMLStreamException
getProperty
public java.lang.Object getProperty(java.lang.String name)
- Specified by:
getProperty
in interface javax.xml.stream.XMLEventReader
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface java.util.Iterator
- Specified by:
hasNext
in interface javax.xml.stream.XMLEventReader
nextEvent
public javax.xml.stream.events.XMLEvent nextEvent()
throws javax.xml.stream.XMLStreamException
- Specified by:
nextEvent
in interface javax.xml.stream.XMLEventReader
- Throws:
javax.xml.stream.XMLStreamException
next
public java.lang.Object next()
- Specified by:
next
in interface java.util.Iterator
nextTag
public javax.xml.stream.events.XMLEvent nextTag()
throws javax.xml.stream.XMLStreamException
- Specified by:
nextTag
in interface javax.xml.stream.XMLEventReader
- Throws:
javax.xml.stream.XMLStreamException
peek
public javax.xml.stream.events.XMLEvent peek()
throws javax.xml.stream.XMLStreamException
- This is bit tricky to implement, but it should filter out
events just as nextEvent() would.
- Specified by:
peek
in interface javax.xml.stream.XMLEventReader
- Throws:
javax.xml.stream.XMLStreamException
remove
public void remove()
- Note: only here because we implement Iterator interface
- Specified by:
remove
in interface java.util.Iterator