Interface XmlPullNode
- All Superinterfaces:
XmlNode, XmlStartTag, XmlTag
This class represents pullable XML subtree - children are built on
demand.
- Author:
- Aleksander Slominski
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionchildren()This is not recommened method to pull children when node is not finished (use readNextChild() instead) as Enumeration interface does not allow to throw XmlPullParserException so any parsing exeption is wrapped into RuntimeException making code more messy...intGet parser that is use to build this node tree and this pull node becomes finished - the caller is responsibile to move pull parser state to the end tag of this node (or parent pull node will be left in unconsistent state!!!!).booleanIs pull parsing of node finished.newNode()context sensitive factory method to create the same type of nodevoidRead all reminaing children up to end tag.This is preferred method to pull children (children() requires .wrapping object Enumeration).voidvoidReset pull node to use pull parser.voidMethods inherited from interface XmlNode
addDeclaredNamespaces, addNamespaceDeclaration, appendChild, ensureChildrenCapacity, ensureDeclaredNamespacesCapacity, getChildAt, getChildrenCount, getDeclaredNamespaceLength, getDefaultNamespaceUri, getParentNode, getQNameLocal, getQNameUri, insertChildAt, namespace2Prefix, newNode, prefix2Namespace, readDeclaredNamespaceUris, readDeclaredPrefixes, removeChildAt, removeChildren, removeDeclaredNamespaces, replaceChildAt, resetNode, setDefaultNamespaceUri, setParentNodeMethods inherited from interface XmlStartTag
addAttribute, addAttribute, ensureAttributesCapacity, getAttributeCount, getAttributeLocalName, getAttributeNamespaceUri, getAttributePrefix, getAttributeRawName, getAttributeValue, getAttributeValueFromName, getAttributeValueFromRawName, isAttributeNamespaceDeclaration, removeAttributeByName, removeAttributeByRawName, removeAttributes, resetStartTagMethods inherited from interface XmlTag
getLocalName, getNamespaceUri, getPrefix, getRawName, modifyTag, resetTag
-
Method Details
-
resetPullNode
void resetPullNode() -
newNode
Description copied from interface:XmlNodecontext sensitive factory method to create the same type of node- Specified by:
newNodein interfaceXmlNode- Throws:
XmlPullParserException
-
newPullNode
- Throws:
XmlPullParserException
-
isFinished
boolean isFinished()Is pull parsing of node finished. -
getPullParser
Get parser that is use to build this node tree and this pull node becomes finished - the caller is responsibile to move pull parser state to the end tag of this node (or parent pull node will be left in unconsistent state!!!!). The returned pull parser position will be before start tag of next child or before final end tag and the caller should use next() to move parser to start reading children. The node state becomes finished and subsequent call to this method will throw exception until setPullParser() is called. The final effect should be equivalen to calling skipNode()!NOTE: this pull node must be in unfinished state or exception will be thrown
- Throws:
IOExceptionXmlPullParserException
-
setPullParser
Reset pull node to use pull parser. Pull Parser must be on START_TAG- Throws:
XmlPullParserException
-
getChildrenCountSoFar
int getChildrenCountSoFar() -
children
Enumeration children()This is not recommened method to pull children when node is not finished (use readNextChild() instead) as Enumeration interface does not allow to throw XmlPullParserException so any parsing exeption is wrapped into RuntimeException making code more messy... -
readNextChild
This is preferred method to pull children (children() requires .wrapping object Enumeration).- Returns:
- next child (which is String or XmlPullNode) or null if there is no re children
- Throws:
XmlPullParserExceptionIOException- See Also:
-
readChildren
Read all reminaing children up to end tag.- Throws:
XmlPullParserExceptionIOException
-
skipChildren
- Throws:
XmlPullParserExceptionIOException
-