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, setParentNode
addAttribute, addAttribute, ensureAttributesCapacity, getAttributeCount, getAttributeLocalName, getAttributeNamespaceUri, getAttributePrefix, getAttributeRawName, getAttributeValue, getAttributeValueFromName, getAttributeValueFromRawName, isAttributeNamespaceDeclaration, removeAttributeByName, removeAttributeByRawName, removeAttributes, resetStartTag
getLocalName, getNamespaceUri, getPrefix, getRawName, hashCode, modifyTag, resetTag
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addDeclaredNamespaces, addNamespaceDeclaration, ensureChildrenCapacity, ensureDeclaredNamespacesCapacity, getDeclaredNamespaceLength, getDefaultNamespaceUri, getParentNode, getQNameLocal, getQNameUri, namespace2Prefix, newNode, prefix2Namespace, readDeclaredNamespaceUris, readDeclaredPrefixes, removeDeclaredNamespaces, resetNode, setDefaultNamespaceUri, setParentNode
addAttribute, addAttribute, ensureAttributesCapacity, getAttributeCount, getAttributeLocalName, getAttributeNamespaceUri, getAttributePrefix, getAttributeRawName, getAttributeValue, getAttributeValueFromName, getAttributeValueFromRawName, isAttributeNamespaceDeclaration, removeAttributeByName, removeAttributeByRawName, removeAttributes, resetStartTag
getLocalName, getNamespaceUri, getPrefix, getRawName, modifyTag, resetTag
protected int depth
protected XmlPullParser pp
public PullNode(XmlPullParser pp) throws XmlPullParserException
XmlPullParserException
public XmlNode newNode() throws XmlPullParserException
Node
newNode
in interface XmlNode
newNode
in interface XmlPullNode
newNode
in class Node
XmlPullParserException
public XmlPullNode newPullNode(XmlPullParser pp) throws XmlPullParserException
newPullNode
in interface XmlPullNode
XmlPullParserException
public void resetPullNode()
resetPullNode
in interface XmlPullNode
public boolean isFinished()
XmlPullNode
isFinished
in interface XmlPullNode
public XmlPullParser getPullParser() throws java.io.IOException, XmlPullParserException
XmlPullNode
NOTE: this pull node must be in unfinished state or exception will be thrown
getPullParser
in interface XmlPullNode
java.io.IOException
XmlPullParserException
public void setPullParser(XmlPullParser pp) throws XmlPullParserException
setPullParser
in interface XmlPullNode
XmlPullParserException
public java.util.Enumeration children()
XmlPullNode
children
in interface XmlNode
children
in interface XmlPullNode
children
in class Node
XmlPullNode.readNextChild()
public java.lang.Object readNextChild() throws XmlPullParserException, java.io.IOException
XmlPullNode
readNextChild
in interface XmlPullNode
XmlPullParserException
java.io.IOException
XmlPullNode.children()
public void readChildren() throws XmlPullParserException, java.io.IOException
readChildren
in interface XmlPullNode
XmlPullParserException
java.io.IOException
public void skipChildren() throws XmlPullParserException, java.io.IOException
skipChildren
in interface XmlPullNode
XmlPullParserException
java.io.IOException
public int getChildrenCountSoFar()
getChildrenCountSoFar
in interface XmlPullNode
public int getChildrenCount()
getChildrenCount
in interface XmlNode
getChildrenCount
in class Node
public java.lang.Object getChildAt(int pos)
getChildAt
in interface XmlNode
getChildAt
in class Node
public void appendChild(java.lang.Object child) throws XmlPullParserException
appendChild
in interface XmlNode
appendChild
in class Node
XmlPullParserException
public void insertChildAt(int pos, java.lang.Object child) throws XmlPullParserException
insertChildAt
in interface XmlNode
insertChildAt
in class Node
XmlPullParserException
public void removeChildAt(int pos) throws XmlPullParserException
removeChildAt
in interface XmlNode
removeChildAt
in class Node
XmlPullParserException
public void replaceChildAt(int pos, java.lang.Object child) throws XmlPullParserException
replaceChildAt
in interface XmlNode
replaceChildAt
in class Node
XmlPullParserException
public void removeChildren() throws XmlPullParserException
XmlNode
removeChildren
in interface XmlNode
removeChildren
in class Node
XmlPullParserException
protected void printFields(java.lang.StringBuffer buf)
printFields
in class Node
Copyright (c) 2003 IU Extreme! Lab http://www.extreme.indiana.edu/ All Rights Reserved.
Note this package is deprecated by XPP3 that implements XmlPull API