Class StAXEventReader
- java.lang.Object
-
- com.sun.xml.fastinfoset.stax.events.StAXEventReader
-
- All Implemented Interfaces:
Iterator<Object>,XMLEventReader
public class StAXEventReader extends Object implements XMLEventReader
-
-
Field Summary
Fields Modifier and Type Field Description protected XMLEventAllocator_eventAllocatorprotected XMLStreamReader_streamReader
-
Constructor Summary
Constructors Constructor Description StAXEventReader(XMLStreamReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()StringgetElementText()Reads the content of a text-only element.ObjectgetProperty(String name)Get the value of a feature/property from the underlying implementationbooleanhasNext()Objectnext()XMLEventnextEvent()XMLEventnextTag()Skips any insignificant space events until a START_ELEMENT or END_ELEMENT is reached.XMLEventpeek()voidremove()voidsetAllocator(XMLEventAllocator allocator)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
_streamReader
protected XMLStreamReader _streamReader
-
_eventAllocator
protected XMLEventAllocator _eventAllocator
-
-
Constructor Detail
-
StAXEventReader
public StAXEventReader(XMLStreamReader reader) throws XMLStreamException
- Throws:
XMLStreamException
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceIterator<Object>- Specified by:
hasNextin interfaceXMLEventReader
-
nextEvent
public XMLEvent nextEvent() throws XMLStreamException
- Specified by:
nextEventin interfaceXMLEventReader- Throws:
XMLStreamException
-
close
public void close() throws XMLStreamException- Specified by:
closein interfaceXMLEventReader- Throws:
XMLStreamException
-
getElementText
public String getElementText() throws 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:
getElementTextin interfaceXMLEventReader- Throws:
XMLStreamException- if the current event is not a START_ELEMENT or if a non text element is encountered
-
getProperty
public Object getProperty(String name) throws IllegalArgumentException
Get the value of a feature/property from the underlying implementation- Specified by:
getPropertyin interfaceXMLEventReader- Parameters:
name- The name of the property- Returns:
- The value of the property
- Throws:
IllegalArgumentException- if the property is not supported
-
nextTag
public XMLEvent nextTag() throws 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:
nextTagin interfaceXMLEventReader- Throws:
XMLStreamException- if anything other than space characters are encountered
-
peek
public XMLEvent peek() throws XMLStreamException
- Specified by:
peekin interfaceXMLEventReader- Throws:
XMLStreamException
-
setAllocator
public void setAllocator(XMLEventAllocator allocator)
-
-