public class XMLReaderImpl extends XMLReaderBase
A concrete XMLReader implementation class.
This implementation uses a specially modified streaming parser to avoid duplicating work already done by the parser itself. This approach makes normal parsing very fast, but recording is expected to be quite poor performancewise.
| Constructor and Description |
|---|
XMLReaderImpl(InputSource source) |
XMLReaderImpl(InputSource source,
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.
|
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 elementId)
Skip all nodes up to the end tag of the element with the given element ID.
|
nextContent, nextElementContent, skipElementpublic XMLReaderImpl(InputSource source)
public XMLReaderImpl(InputSource source, boolean rejectDTDs)
public void close()
XMLReader All subsequent calls to XMLReader.next() will return EOF.
public int getState()
XMLReaderpublic QName getName()
XMLReaderMeaningful only when the state is one of: START, END.
public String getURI()
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 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 getValue()
XMLReaderMeaningful only when the state is one of: CHARS, PI.
public int getElementId()
XMLReaderpublic int getLineNumber()
XMLReaderDue to aggressive parsing, this value may be off by a few lines.
public String getURI(String prefix)
XMLReaderIf there is no namespace declaration in scope for the given prefix, return null.
public Iterator getPrefixes()
XMLReaderpublic int next()
XMLReaderpublic 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 skipElement(int elementId)
XMLReaderskipElement in interface XMLReaderskipElement in class XMLReaderBaseCopyright © 2017–2019 Eclipse Foundation. All rights reserved.