APIdia Launch Partner
Top Fields Constructors Methods
com.sun.xml.internal.stream

public Class XMLEventReaderImpl

extends Object
implements XMLEventReader
Class Inheritance
All Implemented Interfaces
javax.xml.stream.XMLEventReader, java.util.Iterator
Imports
com.sun.xml.internal.stream.events.XMLEventAllocatorImpl, java.util.NoSuchElementException, javax.xml.stream.XMLInputFactory, .XMLStreamConstants, .XMLStreamException, .XMLStreamReader, javax.xml.stream.events.EntityReference, .XMLEvent, javax.xml.stream.util.XMLEventAllocator

Author
@author Neeraj Bajaj Sun Microsystems

Field Summary

Modifier and TypeField and Description
private XMLEvent
private XMLEvent
protected XMLEventAllocator
protected XMLStreamReader

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements javax.xml.stream.XMLEventReader.close.

Frees any resources associated with this Reader.

public String
getElementText()

Implements javax.xml.stream.XMLEventReader.getElementText.

Reads the content of a text-only element.

public Object

Returns:

The value of the property
getProperty
(String
The name of the property
name
)

Implements javax.xml.stream.XMLEventReader.getProperty.

Get the value of a feature/property from the underlying implementation

public boolean
hasNext()

Implements javax.xml.stream.XMLEventReader.hasNext.

Check if there are more events.

public Object
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

public XMLEvent
nextEvent()

Implements javax.xml.stream.XMLEventReader.nextEvent.

Gets the next XMLEvent.

public XMLEvent
nextTag()

Implements javax.xml.stream.XMLEventReader.nextTag.

Skips any insignificant space events until a START_ELEMENT or END_ELEMENT is reached.

public XMLEvent
peek()

Implements javax.xml.stream.XMLEventReader.peek.

Check the next XMLEvent without reading it from the stream.

public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fLastEventback to summary
private XMLEvent fLastEvent
fPeekedEventback to summary
private XMLEvent fPeekedEvent
fXMLEventAllocatorback to summary
protected XMLEventAllocator fXMLEventAllocator
fXMLReaderback to summary
protected XMLStreamReader fXMLReader

Constructor Detail

XMLEventReaderImplback to summary
public XMLEventReaderImpl(XMLStreamReader reader) throws XMLStreamException

Method Detail

closeback to summary
public void close() throws XMLStreamException

Implements javax.xml.stream.XMLEventReader.close.

Doc from javax.xml.stream.XMLEventReader.close.

Frees any resources associated with this Reader. This method does not close the underlying input source.

Exceptions
XMLStreamException:
if there are errors freeing associated resources
getElementTextback to summary
public String getElementText() throws XMLStreamException

Implements javax.xml.stream.XMLEventReader.getElementText.

Reads the content of a text-only element.

Precondition

the current event is START_ELEMENT. Postcondition: The current event is the corresponding END_ELEMENT.

Exceptions
XMLStreamException:
if the current event is not a START_ELEMENT or if a non text element is encountered
getPropertyback to summary
public Object getProperty(String name) throws IllegalArgumentException

Implements javax.xml.stream.XMLEventReader.getProperty.

Get the value of a feature/property from the underlying implementation

Parameters
name:String

The name of the property

Returns:Object

The value of the property

Exceptions
IllegalArgumentException:
if the property is not supported
hasNextback to summary
public boolean hasNext()

Implements javax.xml.stream.XMLEventReader.hasNext.

Doc from javax.xml.stream.XMLEventReader.hasNext.

Check if there are more events. Returns true if there are more events and false otherwise.

nextback to summary
public Object next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

nextEventback to summary
public XMLEvent nextEvent() throws XMLStreamException

Implements javax.xml.stream.XMLEventReader.nextEvent.

Doc from javax.xml.stream.XMLEventReader.nextEvent.

Gets the next XMLEvent. The initial event is StartDocument.

Exceptions
XMLStreamException:
if there is an error with the underlying XML.
nextTagback to summary
public XMLEvent nextTag() throws XMLStreamException

Implements javax.xml.stream.XMLEventReader.nextTag.

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.

Exceptions
XMLStreamException:
if anything other than space characters are encountered
peekback to summary
public XMLEvent peek() throws XMLStreamException

Implements javax.xml.stream.XMLEventReader.peek.

Doc from javax.xml.stream.XMLEventReader.peek.

Check the next XMLEvent without reading it from the stream. Returns null if the stream is at EOF or has no more XMLEvents. A call to peek() will be equal to the next return of next().

Exceptions
XMLStreamException:
if an error occurs
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.