|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.xml.stream.ReaderDelegate
com.bea.xml.stream.StreamReaderFilter
Apply a filter to the StreamReader
Field Summary |
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 | |
StreamReaderFilter(javax.xml.stream.XMLStreamReader reader)
|
|
StreamReaderFilter(javax.xml.stream.XMLStreamReader reader,
javax.xml.stream.StreamFilter filter)
|
Method Summary | |
boolean |
hasNext()
Returns true if there are more parsing events and false if there are no more events. |
static void |
main(java.lang.String[] args)
|
int |
next()
Get next parsing event - a processor may return all contiguous character data in a single chunk, or it may split it into several chunks. |
void |
setFilter(javax.xml.stream.StreamFilter filter)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StreamReaderFilter(javax.xml.stream.XMLStreamReader reader)
public StreamReaderFilter(javax.xml.stream.XMLStreamReader reader, javax.xml.stream.StreamFilter filter)
Method Detail |
public void setFilter(javax.xml.stream.StreamFilter filter)
public int next() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamReader
Given the following XML:
<foo><!--description-->content text<![CDATA[<greeting>Hello</greeting>]]>other content</foo>
The behavior of calling next() when being on foo will be:
1- the comment (COMMENT)
2- then the characters section (CHARACTERS)
3- then the CDATA section (another CHARACTERS)
4- then the next characters section (another CHARACTERS)
5- then the END_ELEMENT
NOTE: empty element (such as <tag/>) will be reported with two separate events: START_ELEMENT, END_ELEMENT - This preserves parsing equivalency of empty element to <tag></tag>. This method will throw an IllegalStateException if it is called after hasNext() returns false.
next
in interface javax.xml.stream.XMLStreamReader
next
in class ReaderDelegate
javax.xml.stream.XMLStreamException
public boolean hasNext() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamReader
hasNext
in interface javax.xml.stream.XMLStreamReader
hasNext
in class ReaderDelegate
javax.xml.stream.XMLStreamException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |