- java.lang.Object
-
- com.sun.xml.fastinfoset.stax.events.StAXEventReader
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.Object>,javax.xml.stream.XMLEventReader
public class StAXEventReader extends java.lang.Object implements javax.xml.stream.XMLEventReader
-
-
Field Summary
Fields Modifier and Type Field Description private javax.xml.stream.events.XMLEvent_currentEventprotected javax.xml.stream.util.XMLEventAllocator_eventAllocatorprotected javax.xml.stream.XMLStreamReader_streamReaderprivate intcurrentIndexprivate javax.xml.stream.events.XMLEvent[]eventsprivate booleanhasEventprivate intsize
-
Constructor Summary
Constructors Constructor Description StAXEventReader(javax.xml.stream.XMLStreamReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.lang.StringgetElementText()Reads the content of a text-only element.java.lang.ObjectgetProperty(java.lang.String name)Get the value of a feature/property from the underlying implementationbooleanhasNext()java.lang.Objectnext()javax.xml.stream.events.XMLEventnextEvent()javax.xml.stream.events.XMLEventnextTag()Skips any insignificant space events until a START_ELEMENT or END_ELEMENT is reached.javax.xml.stream.events.XMLEventpeek()voidremove()voidsetAllocator(javax.xml.stream.util.XMLEventAllocator allocator)
-
-
-
Field Detail
-
_streamReader
protected javax.xml.stream.XMLStreamReader _streamReader
-
_eventAllocator
protected javax.xml.stream.util.XMLEventAllocator _eventAllocator
-
_currentEvent
private javax.xml.stream.events.XMLEvent _currentEvent
-
events
private javax.xml.stream.events.XMLEvent[] events
-
size
private int size
-
currentIndex
private int currentIndex
-
hasEvent
private boolean hasEvent
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<java.lang.Object>- Specified by:
hasNextin interfacejavax.xml.stream.XMLEventReader
-
nextEvent
public javax.xml.stream.events.XMLEvent nextEvent() throws javax.xml.stream.XMLStreamException- Specified by:
nextEventin interfacejavax.xml.stream.XMLEventReader- Throws:
javax.xml.stream.XMLStreamException
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<java.lang.Object>
-
close
public void close() throws javax.xml.stream.XMLStreamException- Specified by:
closein interfacejavax.xml.stream.XMLEventReader- Throws:
javax.xml.stream.XMLStreamException
-
getElementText
public java.lang.String getElementText() throws javax.xml.stream.XMLStreamExceptionReads 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 interfacejavax.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.IllegalArgumentExceptionGet the value of a feature/property from the underlying implementation- Specified by:
getPropertyin interfacejavax.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.XMLStreamExceptionSkips 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 interfacejavax.xml.stream.XMLEventReader- Throws:
javax.xml.stream.XMLStreamException- if anything other than space characters are encountered
-
next
public java.lang.Object next()
- Specified by:
nextin interfacejava.util.Iterator<java.lang.Object>
-
peek
public javax.xml.stream.events.XMLEvent peek() throws javax.xml.stream.XMLStreamException- Specified by:
peekin interfacejavax.xml.stream.XMLEventReader- Throws:
javax.xml.stream.XMLStreamException
-
setAllocator
public void setAllocator(javax.xml.stream.util.XMLEventAllocator allocator)
-
-