public abstract class AbstractStAXStreamReader extends AbstractOutputProcessor implements javax.xml.stream.XMLStreamReader
XMLStreamReader
implementation that reads the XML document
out of a JDOM Document
. This class is marked as abstract even though it is
a full implementation of the XMLReader. This class can be overridden if needed.
If you extend this class, you will need to also extend AbstractStAXStreamReaderProcessor
and supply an instance of that customised class to the StAXStreamReader
class.
The reader reads XML Events by walking the JDOM tree, reporting all XML stream events as it encounters them in the JDOM.
This class is the inverse of the class StAXStreamOutputter
in the sense that
this class is read from (it's an XMLStreamReader implementation) by interpreting a JDOM
Document whereas the StAXStreamOutputter interprets a JDOM Document and writes to
a user-supplied XMLStreamWriter. It is the difference between a 'pull' concept and a
'push' concept.
Constructor and Description |
---|
AbstractStAXStreamReader(Document document)
Create a new AbstractStAXStreamReader that outputs a JDOM Document as an XMLStream using
the Format.getRawFormat() format.
|
AbstractStAXStreamReader(Document document,
Format format)
Create a new AbstractStAXStreamReader that outputs a JDOM Document as an XMLStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
getAttributeCount() |
java.lang.String |
getAttributeLocalName(int index) |
javax.xml.namespace.QName |
getAttributeName(int index) |
java.lang.String |
getAttributeNamespace(int index) |
java.lang.String |
getAttributePrefix(int index) |
java.lang.String |
getAttributeType(int index) |
java.lang.String |
getAttributeValue(int index) |
java.lang.String |
getAttributeValue(java.lang.String namespaceURI,
java.lang.String localName) |
java.lang.String |
getCharacterEncodingScheme() |
java.lang.String |
getElementText() |
java.lang.String |
getEncoding() |
int |
getEventType() |
java.lang.String |
getLocalName() |
javax.xml.stream.Location |
getLocation() |
javax.xml.namespace.QName |
getName() |
javax.xml.namespace.NamespaceContext |
getNamespaceContext() |
int |
getNamespaceCount() |
java.lang.String |
getNamespacePrefix(int index) |
java.lang.String |
getNamespaceURI() |
java.lang.String |
getNamespaceURI(int index) |
java.lang.String |
getNamespaceURI(java.lang.String prefix) |
java.lang.String |
getPIData() |
java.lang.String |
getPITarget() |
java.lang.String |
getPrefix() |
java.lang.Object |
getProperty(java.lang.String name) |
java.lang.String |
getText() |
char[] |
getTextCharacters() |
int |
getTextCharacters(int sourceStart,
char[] target,
int targetStart,
int length) |
int |
getTextLength() |
int |
getTextStart() |
java.lang.String |
getVersion() |
boolean |
hasName() |
boolean |
hasNext() |
boolean |
hasText() |
boolean |
isAttributeSpecified(int index) |
boolean |
isCharacters() |
boolean |
isEndElement() |
boolean |
isStandalone() |
boolean |
isStartElement() |
boolean |
isWhiteSpace() |
int |
next() |
int |
nextTag() |
void |
require(int type,
java.lang.String namespaceURI,
java.lang.String localName) |
boolean |
standaloneSet() |
buildWalker
public AbstractStAXStreamReader(Document document, Format format)
document
- the document to output.format
- The output format to use.public AbstractStAXStreamReader(Document document)
document
- the document to output.public boolean hasNext() throws javax.xml.stream.XMLStreamException
hasNext
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public int next() throws javax.xml.stream.XMLStreamException
next
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public int getEventType()
getEventType
in interface javax.xml.stream.XMLStreamReader
public boolean isStartElement()
isStartElement
in interface javax.xml.stream.XMLStreamReader
public boolean isEndElement()
isEndElement
in interface javax.xml.stream.XMLStreamReader
public boolean isCharacters()
isCharacters
in interface javax.xml.stream.XMLStreamReader
public boolean isWhiteSpace()
isWhiteSpace
in interface javax.xml.stream.XMLStreamReader
public void require(int type, java.lang.String namespaceURI, java.lang.String localName) throws javax.xml.stream.XMLStreamException
require
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public javax.xml.namespace.QName getName()
getName
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getLocalName()
getLocalName
in interface javax.xml.stream.XMLStreamReader
public boolean hasName()
hasName
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getNamespaceURI()
getNamespaceURI
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getPrefix()
getPrefix
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getPITarget()
getPITarget
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getPIData()
getPIData
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getElementText() throws javax.xml.stream.XMLStreamException
getElementText
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public int nextTag() throws javax.xml.stream.XMLStreamException
nextTag
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public void close() throws javax.xml.stream.XMLStreamException
close
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public java.lang.String getNamespaceURI(java.lang.String prefix)
getNamespaceURI
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributeValue(java.lang.String namespaceURI, java.lang.String localName)
getAttributeValue
in interface javax.xml.stream.XMLStreamReader
public int getAttributeCount()
getAttributeCount
in interface javax.xml.stream.XMLStreamReader
public javax.xml.namespace.QName getAttributeName(int index)
getAttributeName
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributeNamespace(int index)
getAttributeNamespace
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributeLocalName(int index)
getAttributeLocalName
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributePrefix(int index)
getAttributePrefix
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributeType(int index)
getAttributeType
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getAttributeValue(int index)
getAttributeValue
in interface javax.xml.stream.XMLStreamReader
public boolean isAttributeSpecified(int index)
isAttributeSpecified
in interface javax.xml.stream.XMLStreamReader
public int getNamespaceCount()
getNamespaceCount
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getNamespacePrefix(int index)
getNamespacePrefix
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getNamespaceURI(int index)
getNamespaceURI
in interface javax.xml.stream.XMLStreamReader
public javax.xml.namespace.NamespaceContext getNamespaceContext()
getNamespaceContext
in interface javax.xml.stream.XMLStreamReader
public boolean hasText()
hasText
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getText()
getText
in interface javax.xml.stream.XMLStreamReader
public char[] getTextCharacters()
getTextCharacters
in interface javax.xml.stream.XMLStreamReader
public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws javax.xml.stream.XMLStreamException
getTextCharacters
in interface javax.xml.stream.XMLStreamReader
javax.xml.stream.XMLStreamException
public int getTextStart()
getTextStart
in interface javax.xml.stream.XMLStreamReader
public int getTextLength()
getTextLength
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getEncoding()
getEncoding
in interface javax.xml.stream.XMLStreamReader
public javax.xml.stream.Location getLocation()
getLocation
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getVersion()
getVersion
in interface javax.xml.stream.XMLStreamReader
public boolean isStandalone()
isStandalone
in interface javax.xml.stream.XMLStreamReader
public boolean standaloneSet()
standaloneSet
in interface javax.xml.stream.XMLStreamReader
public java.lang.String getCharacterEncodingScheme()
getCharacterEncodingScheme
in interface javax.xml.stream.XMLStreamReader
public java.lang.Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException
getProperty
in interface javax.xml.stream.XMLStreamReader
java.lang.IllegalArgumentException
Copyright © 2021 Jason Hunter, Brett McLaughlin. All Rights Reserved.