|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.stax.EmbeddedXMLStreamReader
public class EmbeddedXMLStreamReader
Lazy implementation of a StAX XMLStreamReader
, which directly reads
information from the persistent DOM. The class is optimized to support fast scanning of the DOM, where only
a few selected node properties are requested. Node properties are extracted on demand. For example, the QName of
an element will not be read unless getText()
is called.
Field Summary | |
---|---|
static String |
PROPERTY_NODE_ID
|
Fields inherited from interface javax.xml.stream.XMLStreamConstants |
---|
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT |
Constructor Summary | |
---|---|
EmbeddedXMLStreamReader(DBBroker broker,
DocumentImpl doc,
RawNodeIterator iterator,
boolean reportAttributes)
Construct an EmbeddedXMLStreamReader. |
Method Summary | |
---|---|
void |
close()
|
int |
getAttributeCount()
|
String |
getAttributeLocalName(int i)
|
QName |
getAttributeName(int i)
|
String |
getAttributeNamespace(int i)
|
String |
getAttributePrefix(int i)
|
String |
getAttributeType(int i)
|
String |
getAttributeValue(int i)
|
String |
getAttributeValue(String string,
String string1)
|
String |
getCharacterEncodingScheme()
|
long |
getCurrentPosition()
Returns the (internal) address of the node at the cursor's current position. |
String |
getElementText()
|
String |
getEncoding()
|
int |
getEventType()
|
String |
getLocalName()
|
Location |
getLocation()
|
QName |
getName()
|
NamespaceContext |
getNamespaceContext()
|
int |
getNamespaceCount()
|
String |
getNamespacePrefix(int i)
|
String |
getNamespaceURI()
|
String |
getNamespaceURI(int i)
|
String |
getNamespaceURI(String string)
|
StoredNode |
getNode()
Deserialize the node at the current position of the cursor and return it as a StoredNode . |
short |
getNodeType()
|
String |
getPIData()
|
String |
getPITarget()
|
String |
getPrefix()
|
StoredNode |
getPreviousNode()
Returns the last node in document sequence that occurs before the current node. |
Object |
getProperty(String string)
|
QName |
getQName()
|
String |
getText()
|
char[] |
getTextCharacters()
|
int |
getTextCharacters(int sourceStart,
char[] chars,
int targetStart,
int length)
|
int |
getTextLength()
|
int |
getTextStart()
|
String |
getVersion()
|
boolean |
hasName()
|
boolean |
hasNext()
|
boolean |
hasText()
|
boolean |
isAttributeSpecified(int i)
|
boolean |
isCharacters()
|
boolean |
isEndElement()
|
boolean |
isStandalone()
|
boolean |
isStartElement()
|
boolean |
isWhiteSpace()
|
int |
next()
|
int |
nextTag()
|
void |
reposition(DBBroker broker,
NodeProxy proxy,
boolean reportAttributes)
Reposition the stream reader to another start node, maybe in a different document. |
void |
reposition(DBBroker broker,
StoredNode node,
boolean reportAttributes)
Reposition the stream reader to another start node, maybe in a different document. |
void |
require(int i,
String string,
String string1)
|
boolean |
standaloneSet()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTY_NODE_ID
Constructor Detail |
---|
public EmbeddedXMLStreamReader(DBBroker broker, DocumentImpl doc, RawNodeIterator iterator, boolean reportAttributes) throws XMLStreamException
doc
- the document to which the start node belongs.iterator
- a RawNodeIterator positioned on the start node.reportAttributes
- if set to true, attributes will be reported as top-level events.
XMLStreamException
Method Detail |
---|
public void reposition(DBBroker broker, StoredNode node, boolean reportAttributes) throws IOException
node
- the new start node.reportAttributes
- if set to true, attributes will be reported as top-level events.
IOException
public void reposition(DBBroker broker, NodeProxy proxy, boolean reportAttributes) throws IOException
proxy
- the new start node.reportAttributes
- if set to true, attributes will be reported as top-level events.
IOException
public short getNodeType()
public int next() throws XMLStreamException
next
in interface XMLStreamReader
XMLStreamException
public void require(int i, String string, String string1) throws XMLStreamException
require
in interface XMLStreamReader
XMLStreamException
public String getElementText() throws XMLStreamException
getElementText
in interface XMLStreamReader
XMLStreamException
public Object getProperty(String string) throws IllegalArgumentException
getProperty
in interface XMLStreamReader
IllegalArgumentException
public int nextTag() throws XMLStreamException
nextTag
in interface XMLStreamReader
XMLStreamException
public boolean hasNext() throws XMLStreamException
hasNext
in interface XMLStreamReader
XMLStreamException
public void close() throws XMLStreamException
close
in interface XMLStreamReader
XMLStreamException
public boolean isStartElement()
isStartElement
in interface XMLStreamReader
public boolean isEndElement()
isEndElement
in interface XMLStreamReader
public boolean isCharacters()
isCharacters
in interface XMLStreamReader
public boolean isWhiteSpace()
isWhiteSpace
in interface XMLStreamReader
public String getAttributeValue(String string, String string1)
getAttributeValue
in interface XMLStreamReader
public int getAttributeCount()
getAttributeCount
in interface XMLStreamReader
public QName getAttributeName(int i)
getAttributeName
in interface XMLStreamReader
public String getAttributeNamespace(int i)
getAttributeNamespace
in interface XMLStreamReader
public String getAttributeLocalName(int i)
getAttributeLocalName
in interface XMLStreamReader
public String getAttributePrefix(int i)
getAttributePrefix
in interface XMLStreamReader
public String getAttributeType(int i)
getAttributeType
in interface XMLStreamReader
public String getAttributeValue(int i)
getAttributeValue
in interface XMLStreamReader
public boolean isAttributeSpecified(int i)
isAttributeSpecified
in interface XMLStreamReader
public int getNamespaceCount()
getNamespaceCount
in interface XMLStreamReader
public String getNamespacePrefix(int i)
getNamespacePrefix
in interface XMLStreamReader
public String getNamespaceURI(int i)
getNamespaceURI
in interface XMLStreamReader
public NamespaceContext getNamespaceContext()
getNamespaceContext
in interface XMLStreamReader
public int getEventType()
getEventType
in interface XMLStreamReader
public String getText()
getText
in interface XMLStreamReader
public char[] getTextCharacters()
getTextCharacters
in interface XMLStreamReader
public int getTextCharacters(int sourceStart, char[] chars, int targetStart, int length) throws XMLStreamException
getTextCharacters
in interface XMLStreamReader
XMLStreamException
public int getTextStart()
getTextStart
in interface XMLStreamReader
public int getTextLength()
getTextLength
in interface XMLStreamReader
public String getEncoding()
getEncoding
in interface XMLStreamReader
public boolean hasText()
hasText
in interface XMLStreamReader
public Location getLocation()
getLocation
in interface XMLStreamReader
public String getNamespaceURI(String string)
getNamespaceURI
in interface XMLStreamReader
public QName getName()
getName
in interface XMLStreamReader
public QName getQName()
public String getPrefix()
getPrefix
in interface XMLStreamReader
public String getLocalName()
getLocalName
in interface XMLStreamReader
public String getNamespaceURI()
getNamespaceURI
in interface XMLStreamReader
public boolean hasName()
hasName
in interface XMLStreamReader
public StoredNode getNode()
StoredNode
.
public StoredNode getPreviousNode()
public long getCurrentPosition()
public String getVersion()
getVersion
in interface XMLStreamReader
public boolean isStandalone()
isStandalone
in interface XMLStreamReader
public boolean standaloneSet()
standaloneSet
in interface XMLStreamReader
public String getCharacterEncodingScheme()
getCharacterEncodingScheme
in interface XMLStreamReader
public String getPITarget()
getPITarget
in interface XMLStreamReader
public String getPIData()
getPIData
in interface XMLStreamReader
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |