|
Qizx/db 2.1 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Streaming input of XML contents, working in 'pull' mode.
An object implementing this interface delivers the contents of an XML Node as a stream of "events", enumerated under control of the calling code (hence the term "pull mode"). An element appears as a pair of events ELEMENT_START, ELEMENT_END enclosing the events corresponding to the contents of the element. Atomic nodes (text, comment, PI) appear as a single event.
The stream is forward only. A method moveToNextEvent() both moves
the stream to the next event and returns the type of this event
(ELEMENT_START, TEXT, ELEMENT_END etc.). The current event type is also
available through the method getCurrentEvent().
Other methods provide access to event-specific values such as element name, attributes, namespace declarations, textual contents.
Note: this interface is similar in essence to javax.xml.stream.XMLStreamReader, but simpler. The iteration style is slightly different since there is no hasNext() method.
| Field Summary | |
static int |
COMMENT
Value returned by moveToNext and getEvent when a comment is reached. |
static int |
DOCUMENT_END
Value returned by moveToNext and getEvent when the end of the document is reached. |
static int |
DOCUMENT_START
Value returned by moveToNext and getEvent when the beginning of a document is reached. |
static int |
ELEMENT_END
Value returned by moveToNext and getEvent when the end of an element is reached. |
static int |
ELEMENT_START
Value returned by moveToNext and getEvent when the beginning of an element is reached. |
static int |
END
Value returned by moveToNext and getEvent when the end of stream is reached. |
static int |
PROCESSING_INSTRUCTION
Value returned by moveToNext and getEvent when a processing-instruction is reached. |
static int |
START
Value returned by getEvent before the first call to moveToNext. |
static int |
TEXT
Value returned by moveToNext and getEvent when a text node is reached. |
| Method Summary | |
int |
getAttributeCount()
On ELEMENT_START, returns the number of attributes of the element. |
QName |
getAttributeName(int index)
On ELEMENT_START, returns the name of the N-th attribute of the element. |
String |
getAttributeValue(int index)
On ELEMENT_START, returns the string-value of the N-th attribute of the element. |
int |
getCurrentEvent()
Returns the same value as the latest moveToNextEvent. |
String |
getDTDName()
Returns the declared DTD name of the document, if any. |
String |
getDTDPublicId()
Returns the declared Public ID of the DTD, if any. |
String |
getDTDSystemId()
Returns the declared System ID of the DTD, if any. |
String |
getEncoding()
Returns the declared encoding of the document, if any. |
String |
getInternalSubset()
Returns the source form of internal subset of the DTD, if any. |
QName |
getName()
Returns the name of the current element node, or if the node is not an element, returns the name of the parent element. |
int |
getNamespaceCount()
On ELEMENT_START, returns the number of namespace declarations of the element itself. |
String |
getNamespacePrefix(int index)
On ELEMENT_START, returns the prefix of the N-th namespace declaration of the element. |
String |
getNamespaceURI(int index)
On ELEMENT_START, returns the namespace URI of the N-th namespace declaration of the element. |
String |
getTarget()
Returns the target name for a PROCESSING_INSTRUCTION. |
String |
getText()
Returns the textual contents of an atomic node. |
int |
getTextLength()
Returns the size of the textual contents of an atomic node. |
int |
moveToNextEvent()
Moves the event stream one step forward. |
| Field Detail |
public static final int END
public static final int START
public static final int DOCUMENT_START
public static final int DOCUMENT_END
public static final int ELEMENT_START
public static final int ELEMENT_END
public static final int TEXT
public static final int COMMENT
public static final int PROCESSING_INSTRUCTION
| Method Detail |
public int moveToNextEvent()
throws DataModelException
END.
DataModelException - may be thrown by the stream implementation in
case access to data is impossible (deleted document, closed Library).public int getCurrentEvent()
public String getEncoding()
public String getDTDName()
public String getDTDPublicId()
public String getDTDSystemId()
public String getInternalSubset()
public QName getName()
public int getAttributeCount()
public QName getAttributeName(int index)
index - of the attribute (starting from 0)
IndexOutOfBoundsException - if not on an element start, of the
index is invalid.public String getAttributeValue(int index)
index - of the attribute (starting from 0)
IndexOutOfBoundsException - if not on an element start, of the
index is invalid.public int getNamespaceCount()
public String getNamespacePrefix(int index)
index - of the namespace declaration (starting from 0)
IndexOutOfBoundsException - if not on an element start, of the
index is invalid.public String getNamespaceURI(int index)
index - of the namespace declaration (starting from 0)
IndexOutOfBoundsException - if not on an element start, of the
index is invalid.public String getText()
public int getTextLength()
getText()public String getTarget()
|
© 2008 Axyana Software | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||