public class MetaXMLStreamReader extends AbstractMetaXMLReader implements XMLStreamReader
LiteralMetadataContentEvent
s using an XMLStreamReader
.
Instances of this class should not (and cannot) be created directly in application code, but
JPhyloIOXMLEventReader.createMetaXMLStreamReader()
should be used instead.
Since it is registered which events are read from the event stream, it is possible to read only a part of the
custom XML tree with this reader, while the rest is read using the original JPhyloIOEventReader
.
Note that all methods intended to obtain information about the document start refer to the start of the whole document, not only the custom XML tree.
Methods of this reader referring to element text as a character array , e.g. getTextCharacters()
, all work
on a string representation obtained from a characters event. The usual performance benefits in using these character
array based methods do not apply for this implementation, since it works on an underlying instance of
JPhyloIOEventReader
.
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Constructor and Description |
---|
MetaXMLStreamReader(XMLReaderStreamDataProvider<?> streamDataProvider)
Creates a new instance of this class.
|
close, getEventFactory, getJPhyloIOEventReader, getProperty, getStreamDataProvider, hasNext, isEndDocumentFired, isEndReached, isStartDocumentFired, obtainXMLContentEvent, setEndDocumentFired, setEndReached, setStartDocumentFired
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getProperty, hasNext
public MetaXMLStreamReader(XMLReaderStreamDataProvider<?> streamDataProvider)
JPhyloIOXMLEventReader.createMetaXMLStreamReader()
instead.streamDataProvider
- the stream data provider of the underlying JPhyloIOEventReader
public int getAttributeCount()
getAttributeCount
in interface XMLStreamReader
public String getAttributeLocalName(int index)
getAttributeLocalName
in interface XMLStreamReader
public QName getAttributeName(int index)
getAttributeName
in interface XMLStreamReader
public String getAttributeNamespace(int index)
getAttributeNamespace
in interface XMLStreamReader
public String getAttributePrefix(int index)
getAttributePrefix
in interface XMLStreamReader
public String getAttributeType(int index)
getAttributeType
in interface XMLStreamReader
public String getAttributeValue(int index)
getAttributeValue
in interface XMLStreamReader
public String getAttributeValue(String namespaceURI, String localName)
getAttributeValue
in interface XMLStreamReader
public String getCharacterEncodingScheme()
getCharacterEncodingScheme
in interface XMLStreamReader
public String getElementText() throws XMLStreamException
getElementText
in interface XMLStreamReader
XMLStreamException
public String getEncoding()
getEncoding
in interface XMLStreamReader
public int getEventType()
getEventType
in interface XMLStreamReader
public String getLocalName()
getLocalName
in interface XMLStreamReader
public Location getLocation()
getLocation
in interface XMLStreamReader
public QName getName()
getName
in interface XMLStreamReader
public NamespaceContext getNamespaceContext()
getNamespaceContext
in interface XMLStreamReader
public int getNamespaceCount()
getNamespaceCount
in interface XMLStreamReader
public String getNamespacePrefix(int index)
getNamespacePrefix
in interface XMLStreamReader
public String getNamespaceURI()
getNamespaceURI
in interface XMLStreamReader
public String getNamespaceURI(int index)
getNamespaceURI
in interface XMLStreamReader
public String getNamespaceURI(String prefix)
getNamespaceURI
in interface XMLStreamReader
public String getPIData()
getPIData
in interface XMLStreamReader
public String getPITarget()
getPITarget
in interface XMLStreamReader
public String getPrefix()
getPrefix
in interface XMLStreamReader
public String getText()
getText
in interface XMLStreamReader
public char[] getTextCharacters()
getTextCharacters
in interface XMLStreamReader
public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException
getTextCharacters
in interface XMLStreamReader
XMLStreamException
public int getTextLength()
getTextLength
in interface XMLStreamReader
public int getTextStart()
getTextStart
in interface XMLStreamReader
public String getVersion()
getVersion
in interface XMLStreamReader
public boolean hasName()
hasName
in interface XMLStreamReader
public boolean hasText()
hasText
in interface XMLStreamReader
public boolean isAttributeSpecified(int index)
isAttributeSpecified
in interface XMLStreamReader
public boolean isCharacters()
isCharacters
in interface XMLStreamReader
public boolean isEndElement()
isEndElement
in interface XMLStreamReader
public boolean isStandalone()
isStandalone
in interface XMLStreamReader
public boolean isStartElement()
isStartElement
in interface XMLStreamReader
public boolean isWhiteSpace()
isWhiteSpace
in interface XMLStreamReader
public int next() throws XMLStreamException
next
in interface XMLStreamReader
XMLStreamException
public int nextTag() throws XMLStreamException
nextTag
in interface XMLStreamReader
XMLStreamException
public void require(int type, String namespaceURI, String localName) throws XMLStreamException
require
in interface XMLStreamReader
XMLStreamException
public boolean standaloneSet()
standaloneSet
in interface XMLStreamReader