class NamespaceContextCorrectingXMLStreamReaderWrapper extends XMLStreamReaderWrapper implements DelegatingXMLStreamReader
XMLStreamReader wrapper that tracks the namespace bindings on behalf of the underlying
reader. This class may be used to wrap XMLStreamReader instances known to have issues in
their namespace context implementation. It tracks the namespace bindings using the
XMLStreamReader.getNamespacePrefix(int) and XMLStreamReader.getNamespaceURI(int)
methods and exposes this information by overriding the
XMLStreamReader.getNamespaceContext() and XMLStreamReader.getNamespaceURI(String)
methods. Invocations of these two methods will therefore never reach the underlying reader.| Modifier and Type | Field and Description |
|---|---|
private ScopedNamespaceContext |
namespaceContext |
| Constructor and Description |
|---|
NamespaceContextCorrectingXMLStreamReaderWrapper(javax.xml.stream.XMLStreamReader parent)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
javax.xml.namespace.NamespaceContext |
getNamespaceContext() |
java.lang.String |
getNamespaceURI(java.lang.String prefix) |
javax.xml.stream.XMLStreamReader |
getParent()
Get the parent stream reader.
|
int |
next() |
int |
nextTag() |
private void |
startElement() |
close, getAttributeCount, getAttributeLocalName, getAttributeName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getAttributeValue, getCharacterEncodingScheme, getElementText, getEncoding, getEventType, getLocalName, getLocation, getName, getNamespaceCount, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getPIData, getPITarget, getPrefix, getProperty, getText, getTextCharacters, getTextCharacters, getTextLength, getTextStart, getVersion, hasName, hasNext, hasText, isAttributeSpecified, isCharacters, isEndElement, isStandalone, isStartElement, isWhiteSpace, require, standaloneSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getAttributeCount, getAttributeLocalName, getAttributeName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getAttributeValue, getCharacterEncodingScheme, getElementText, getEncoding, getEventType, getLocalName, getLocation, getName, getNamespaceCount, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getPIData, getPITarget, getPrefix, getProperty, getText, getTextCharacters, getTextCharacters, getTextLength, getTextStart, getVersion, hasName, hasNext, hasText, isAttributeSpecified, isCharacters, isEndElement, isStandalone, isStartElement, isWhiteSpace, require, standaloneSetprivate final ScopedNamespaceContext namespaceContext
public NamespaceContextCorrectingXMLStreamReaderWrapper(javax.xml.stream.XMLStreamReader parent)
parent - the parent readerprivate void startElement()
public int next()
throws javax.xml.stream.XMLStreamException
next in interface javax.xml.stream.XMLStreamReadernext in class XMLStreamReaderWrapperjavax.xml.stream.XMLStreamExceptionpublic int nextTag()
throws javax.xml.stream.XMLStreamException
nextTag in interface javax.xml.stream.XMLStreamReadernextTag in class XMLStreamReaderWrapperjavax.xml.stream.XMLStreamExceptionpublic javax.xml.namespace.NamespaceContext getNamespaceContext()
getNamespaceContext in interface javax.xml.stream.XMLStreamReadergetNamespaceContext in class XMLStreamReaderWrapperpublic java.lang.String getNamespaceURI(java.lang.String prefix)
getNamespaceURI in interface javax.xml.stream.XMLStreamReadergetNamespaceURI in class XMLStreamReaderWrapperpublic javax.xml.stream.XMLStreamReader getParent()
XMLStreamReaderWrapperDelegatingXMLStreamReader interface to make
this a public method. Note that a corresponding setParent method is
intentionally omitted because XMLStreamReaderWrapper is immutable.getParent in interface DelegatingXMLStreamReadergetParent in class XMLStreamReaderWrapper