com.sun.xml.stream
Class XMLEventReaderImpl

java.lang.Object
  extended by com.sun.xml.stream.XMLEventReaderImpl
All Implemented Interfaces:
java.util.Iterator, javax.xml.stream.XMLEventReader

public class XMLEventReaderImpl
extends java.lang.Object
implements javax.xml.stream.XMLEventReader

Author:
@author Neeraj Bajaj Sun Microsystems

Field Summary
protected  javax.xml.stream.util.XMLEventAllocator fXMLEventAllocator
           
protected  javax.xml.stream.XMLStreamReader fXMLReader
           
 
Constructor Summary
XMLEventReaderImpl(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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fXMLReader

protected javax.xml.stream.XMLStreamReader fXMLReader

fXMLEventAllocator

protected javax.xml.stream.util.XMLEventAllocator fXMLEventAllocator
Constructor Detail

XMLEventReaderImpl

public XMLEventReaderImpl(javax.xml.stream.XMLStreamReader reader)
                   throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException
Method Detail

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


Copyright ? 2002-2003 Apache XML Project. All Rights Reserved.