| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
XMLInputFactory factory = …;
String uri = …;
InputStream input = …;
XMLEventReader r = factory.createXMLEventReader(uri, input);
Based on 18 examples
public interface XMLEventReader extends Iterator
This is the top level interface for parsing XML Events. It provides the ability to peek at the next event and returns configuration information through the property interface.
Method Summary | |
---|---|
void |
close() Frees any resources associated with this Reader. |
String |
Reads the content of a text-only element. |
Object |
getProperty(String name) Get the value of a feature/property from the underlying implementation |
boolean |
hasNext() Check if there are more events. |
XMLEvent |
Get the next XMLEvent |
XMLEvent |
nextTag() Skips any insignificant space events until a START_ELEMENT or END_ELEMENT is reached. |
XMLEvent |
peek() Check the next XMLEvent without reading it from the stream. |
Methods inherited from class java.util.Iterator |
---|
hasNext, next, remove |
Method Detail |
---|
public void close() throws XMLStreamException
XMLStreamException
- if there are errors freeing associated resourcespublic String getElementText() throws XMLStreamException
XMLStreamException
- if the current event is not a START_ELEMENT
or if a non text element is encounteredpublic Object getProperty(String name) throws IllegalArgumentException
name
- The name of the propertyIllegalArgumentException
- if the property is not supportedpublic boolean hasNext()
public XMLEvent nextEvent() throws XMLStreamException
XMLStreamException
- if there is an error with the underlying XML.public XMLEvent nextTag() throws XMLStreamException
XMLStreamException
- if anything other than space characters are encounteredpublic XMLEvent peek() throws XMLStreamException
XMLStreamException
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |