javax.xml.stream
Interface XMLEventReader

All Superinterfaces:
Iterator
All Known Implementing Classes:
EventReaderDelegate

public interface XMLEventReader
extends Iterator

An XML parser.


Method Summary
 void close()
          Free any resources associated with this parser.
 String getElementText()
          Reads the text context of an element.
 Object getProperty(String name)
          Returns the implementation-specific feature or property of the given name.
 boolean hasNext()
          Indicates whether there are more XML events to be read.
 XMLEvent nextEvent()
          Returns the next XML event.
 XMLEvent nextTag()
          Returns the next element event.
 XMLEvent peek()
          Looks at the next XML event without advancing the cursor in the stream.
 
Methods inherited from interface java.util.Iterator
next, remove
 

Method Detail

nextEvent

XMLEvent nextEvent()
                   throws XMLStreamException
Returns the next XML event.

Throws:
XMLStreamException

hasNext

boolean hasNext()
Indicates whether there are more XML events to be read.

Specified by:
hasNext in interface Iterator
Returns:
true if there is at least one more element in the collection

peek

XMLEvent peek()
              throws XMLStreamException
Looks at the next XML event without advancing the cursor in the stream. Returns null if there are no more events to read.

Throws:
XMLStreamException

getElementText

String getElementText()
                      throws XMLStreamException
Reads the text context of an element. When invoked, the current event must be START_ELEMENT. On completion, the current event will be END_ELEMENT.

Throws:
XMLStreamException

nextTag

XMLEvent nextTag()
                 throws XMLStreamException
Returns the next element event. This method skips insignificant space until a START_ELEMENT or END_ELEMENT event is found.

Throws:
XMLStreamException - if an event that was not an insignificant space event was encountered

getProperty

Object getProperty(String name)
                   throws IllegalArgumentException
Returns the implementation-specific feature or property of the given name.

Throws:
IllegalArgumentException - if the property is not supported

close

void close()
           throws XMLStreamException
Free any resources associated with this parser. This method will not close the underlying input source.

Throws:
XMLStreamException