public class StAXReader extends XMLReaderBase
| Modifier and Type | Class and Description |
|---|---|
static class |
StAXReader.AttributesImpl |
| Constructor and Description |
|---|
StAXReader(InputSource source,
boolean rejectDTDs) |
StAXReader(InputSource source,
boolean rejectDTDs,
XMLStreamReader reader) |
StAXReader(Source source,
boolean rejectDTDs) |
StAXReader(StringReader stringReader,
boolean rejectDTDs) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the XMLReader.
|
Attributes |
getAttributes()
Return the current attribute list.
|
int |
getElementId()
Return the current element ID.
|
int |
getLineNumber()
Return the current line number.
|
String |
getLocalName()
Return the current local name.
|
QName |
getName()
Return the current qualified name.
|
Iterator |
getPrefixes()
Return an iterator on all prefixes in scope, except for the default prefix.
|
int |
getState()
Return the current state of the XMLReader.
|
String |
getURI()
Return the current URI.
|
String |
getURI(String prefix)
Return the URI for the given prefix.
|
String |
getValue()
Return the current value.
|
XMLStreamReader |
getXMLStreamReader()
Returns the StAX XMLStreamReader that is being used.
|
int |
next()
Return the next state of the XMLReader.
|
XMLReader |
recordElement()
Records the current element and leaves the reader positioned on its end tag.
|
void |
skipElement(int id)
Skip all nodes up to the end tag of the element with the given element ID.
|
void |
synchronizeReader()
Used to resync the StAXReader with its underlying XMLStreamReader.
|
nextContent, nextElementContent, skipElementpublic StAXReader(InputSource source, boolean rejectDTDs)
public StAXReader(InputSource source, boolean rejectDTDs, XMLStreamReader reader)
public StAXReader(Source source, boolean rejectDTDs)
public StAXReader(StringReader stringReader, boolean rejectDTDs)
public XMLStreamReader getXMLStreamReader()
synchronizeReader()public void synchronizeReader()
getXMLStreamReader()public int next()
XMLReaderpublic int getState()
XMLReaderpublic QName getName()
XMLReaderMeaningful only when the state is one of: START, END.
public String getLocalName()
XMLReaderMeaningful only when the state is one of: START, END, PI.
public String getURI()
XMLReaderMeaningful only when the state is one of: START, END.
public Attributes getAttributes()
XMLReaderMeaningful only when the state is one of: START.
The returned Attributes object belong to the XMLReader and is
only guaranteed to be valid until the XMLReader.next() method is called,
directly or indirectly.
public String getURI(String prefix)
XMLReaderIf there is no namespace declaration in scope for the given prefix, return null.
public String getValue()
XMLReaderMeaningful only when the state is one of: CHARS, PI.
public int getLineNumber()
XMLReaderDue to aggressive parsing, this value may be off by a few lines.
public Iterator getPrefixes()
XMLReaderpublic int getElementId()
XMLReaderpublic void skipElement(int id)
XMLReaderskipElement in interface XMLReaderskipElement in class XMLReaderBasepublic XMLReader recordElement()
XMLReaderThe XMLReader must be positioned on the start tag of the element. The returned reader will play back all events starting with the start tag of the element and ending with its end tag.
public void close()
XMLReader All subsequent calls to XMLReader.next() will return EOF.
Copyright © 2017–2019 Eclipse Foundation. All rights reserved.