public class PullNode extends Node implements XmlPullNode
| Modifier and Type | Field and Description |
|---|---|
protected int |
depth |
protected XmlPullParser |
pp |
children, childrenCount, declaredNs, declaredNsEnd, declaredPrefixes, defaultNamespaceUri, EMPTY_ENUMERATION, oneChild, parent, prefix2Ns| Constructor and Description |
|---|
PullNode(XmlPullParser pp) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendChild(java.lang.Object child) |
java.util.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...
|
java.lang.Object |
getChildAt(int pos) |
int |
getChildrenCount()
it will reconsruct whole subtree to get count ...
|
int |
getChildrenCountSoFar()
if unfinished it returns actual number of children...
|
XmlPullParser |
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!!!!).
|
void |
insertChildAt(int pos,
java.lang.Object child) |
boolean |
isFinished()
Is pull parsing of node finished.
|
XmlNode |
newNode()
context sensitive factory method to create the same type of node
|
XmlPullNode |
newPullNode(XmlPullParser pp) |
protected void |
printFields(java.lang.StringBuffer buf)
Print this class state into StringBuffer element name
|
void |
readChildren()
Read all reminaing children up to end tag.
|
java.lang.Object |
readNextChild()
This is preferred method to pull children
(children() requires .wrapping object Enumeration).
|
void |
removeChildAt(int pos) |
void |
removeChildren()
Removes all children - every child that was
implementing XmlNode will have set parent to null.
|
void |
replaceChildAt(int pos,
java.lang.Object child) |
void |
resetPullNode()
PullNode stays in finished state.
|
void |
setPullParser(XmlPullParser pp)
Reset pull node to use pull parser.
|
void |
skipChildren() |
java.lang.String |
toString()
Return string representation of start tag including name
and list of attributes.
|
addDeclaredNamespaces, addNamespaceDeclaration, ensureChildrenCapacity, ensureDeclaredNamespacesCapacity, equals, getDeclaredNamespaceLength, getDefaultNamespaceUri, getParentNode, getQNameLocal, getQNameUri, namespace2Prefix, newNode, prefix2Namespace, readDeclaredNamespaceUris, readDeclaredPrefixes, removeDeclaredNamespaces, resetNode, setDefaultNamespaceUri, setParentNodeaddAttribute, addAttribute, ensureAttributesCapacity, getAttributeCount, getAttributeLocalName, getAttributeNamespaceUri, getAttributePrefix, getAttributeRawName, getAttributeValue, getAttributeValueFromName, getAttributeValueFromRawName, isAttributeNamespaceDeclaration, removeAttributeByName, removeAttributeByRawName, removeAttributes, resetStartTaggetLocalName, getNamespaceUri, getPrefix, getRawName, hashCode, modifyTag, resetTagclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddDeclaredNamespaces, addNamespaceDeclaration, ensureChildrenCapacity, ensureDeclaredNamespacesCapacity, getDeclaredNamespaceLength, getDefaultNamespaceUri, getParentNode, getQNameLocal, getQNameUri, namespace2Prefix, newNode, prefix2Namespace, readDeclaredNamespaceUris, readDeclaredPrefixes, removeDeclaredNamespaces, resetNode, setDefaultNamespaceUri, setParentNodeaddAttribute, addAttribute, ensureAttributesCapacity, getAttributeCount, getAttributeLocalName, getAttributeNamespaceUri, getAttributePrefix, getAttributeRawName, getAttributeValue, getAttributeValueFromName, getAttributeValueFromRawName, isAttributeNamespaceDeclaration, removeAttributeByName, removeAttributeByRawName, removeAttributes, resetStartTaggetLocalName, getNamespaceUri, getPrefix, getRawName, modifyTag, resetTagprotected int depth
protected XmlPullParser pp
public PullNode(XmlPullParser pp) throws XmlPullParserException
XmlPullParserExceptionpublic XmlNode newNode() throws XmlPullParserException
NodenewNode in interface XmlNodenewNode in interface XmlPullNodenewNode in class NodeXmlPullParserExceptionpublic XmlPullNode newPullNode(XmlPullParser pp) throws XmlPullParserException
newPullNode in interface XmlPullNodeXmlPullParserExceptionpublic void resetPullNode()
resetPullNode in interface XmlPullNodepublic boolean isFinished()
XmlPullNodeisFinished in interface XmlPullNodepublic XmlPullParser getPullParser() throws java.io.IOException, XmlPullParserException
XmlPullNodeNOTE: this pull node must be in unfinished state or exception will be thrown
getPullParser in interface XmlPullNodejava.io.IOExceptionXmlPullParserExceptionpublic void setPullParser(XmlPullParser pp) throws XmlPullParserException
setPullParser in interface XmlPullNodeXmlPullParserExceptionpublic java.util.Enumeration children()
XmlPullNodechildren in interface XmlNodechildren in interface XmlPullNodechildren in class NodeXmlPullNode.readNextChild()public java.lang.Object readNextChild()
throws XmlPullParserException,
java.io.IOException
XmlPullNodereadNextChild in interface XmlPullNodeXmlPullParserExceptionjava.io.IOExceptionXmlPullNode.children()public void readChildren()
throws XmlPullParserException,
java.io.IOException
readChildren in interface XmlPullNodeXmlPullParserExceptionjava.io.IOExceptionpublic void skipChildren()
throws XmlPullParserException,
java.io.IOException
skipChildren in interface XmlPullNodeXmlPullParserExceptionjava.io.IOExceptionpublic int getChildrenCountSoFar()
getChildrenCountSoFar in interface XmlPullNodepublic int getChildrenCount()
getChildrenCount in interface XmlNodegetChildrenCount in class Nodepublic java.lang.Object getChildAt(int pos)
getChildAt in interface XmlNodegetChildAt in class Nodepublic void appendChild(java.lang.Object child)
throws XmlPullParserException
appendChild in interface XmlNodeappendChild in class NodeXmlPullParserExceptionpublic void insertChildAt(int pos,
java.lang.Object child)
throws XmlPullParserException
insertChildAt in interface XmlNodeinsertChildAt in class NodeXmlPullParserExceptionpublic void removeChildAt(int pos)
throws XmlPullParserException
removeChildAt in interface XmlNoderemoveChildAt in class NodeXmlPullParserExceptionpublic void replaceChildAt(int pos,
java.lang.Object child)
throws XmlPullParserException
replaceChildAt in interface XmlNodereplaceChildAt in class NodeXmlPullParserExceptionpublic void removeChildren()
throws XmlPullParserException
XmlNoderemoveChildren in interface XmlNoderemoveChildren in class NodeXmlPullParserExceptionprotected void printFields(java.lang.StringBuffer buf)
printFields in class NodeCopyright (c) 2003 IU Extreme! Lab http://www.extreme.indiana.edu/ All Rights Reserved.
Note this package is deprecated by XPP3 that implements XmlPull API