com.sun.xml.fastinfoset.stax.events
Class StAXEventReader
java.lang.Object
com.sun.xml.fastinfoset.stax.events.StAXEventReader
- All Implemented Interfaces:
- java.util.Iterator, javax.xml.stream.XMLEventReader
public class StAXEventReader
- extends java.lang.Object
- implements javax.xml.stream.XMLEventReader
|
Constructor Summary |
StAXEventReader(javax.xml.stream.XMLStreamReader reader)
|
|
Method Summary |
void |
close()
|
java.lang.String |
getElementText()
Reads the content of a text-only element. |
java.lang.Object |
getProperty(java.lang.String name)
Get the value of a feature/property from the underlying implementation |
boolean |
hasNext()
|
java.lang.Object |
next()
|
javax.xml.stream.events.XMLEvent |
nextEvent()
|
javax.xml.stream.events.XMLEvent |
nextTag()
Skips any insignificant space events until a START_ELEMENT or
END_ELEMENT is reached. |
javax.xml.stream.events.XMLEvent |
peek()
|
void |
remove()
|
void |
setAllocator(javax.xml.stream.util.XMLEventAllocator allocator)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_streamReader
protected javax.xml.stream.XMLStreamReader _streamReader
_eventAllocator
protected javax.xml.stream.util.XMLEventAllocator _eventAllocator
StAXEventReader
public StAXEventReader(javax.xml.stream.XMLStreamReader reader)
throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
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
remove
public void remove()
- Specified by:
remove in interface java.util.Iterator
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
- Reads the content of a text-only element. Precondition:
the current event is START_ELEMENT. Postcondition:
The current event is the corresponding END_ELEMENT.
- Specified by:
getElementText in interface javax.xml.stream.XMLEventReader
- Throws:
javax.xml.stream.XMLStreamException - if the current event is not a START_ELEMENT
or if a non text element is encountered
getProperty
public java.lang.Object getProperty(java.lang.String name)
throws java.lang.IllegalArgumentException
- Get the value of a feature/property from the underlying implementation
- Specified by:
getProperty in interface javax.xml.stream.XMLEventReader
- Parameters:
name - The name of the property
- Returns:
- The value of the property
- Throws:
java.lang.IllegalArgumentException - if the property is not supported
nextTag
public javax.xml.stream.events.XMLEvent nextTag()
throws javax.xml.stream.XMLStreamException
- Skips any insignificant space events until a START_ELEMENT or
END_ELEMENT is reached. If anything other than space characters are
encountered, an exception is thrown. This method should
be used when processing element-only content because
the parser is not able to recognize ignorable whitespace if
the DTD is missing or not interpreted.
- Specified by:
nextTag in interface javax.xml.stream.XMLEventReader
- Throws:
javax.xml.stream.XMLStreamException - if anything other than space characters are encountered
next
public java.lang.Object next()
- Specified by:
next in interface java.util.Iterator
peek
public javax.xml.stream.events.XMLEvent peek()
throws javax.xml.stream.XMLStreamException
- Specified by:
peek in interface javax.xml.stream.XMLEventReader
- Throws:
javax.xml.stream.XMLStreamException
setAllocator
public void setAllocator(javax.xml.stream.util.XMLEventAllocator allocator)
Copyright © 2005-2011 Oracle Corporation. All Rights Reserved.