|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gjt.xpp.impl.tag.Tag
org.gjt.xpp.impl.tag.StartTag
org.gjt.xpp.impl.node.Node
org.gjt.xpp.impl.pullnode.PullNode
Allows node tree to be constructed on demand. When PullNode is constructed and method setPullPasrser() is executed (or constructor with PullParser arg is called) node is assumend to be incomplete and children will be retrieved on demand (pulled) including automatic creation of sub pull nodes. If no pull parser is associated (it is null) this class must work like regular XmlNode...
Field Summary | |
protected int |
depth
|
protected XmlPullParser |
pp
|
Fields inherited from class org.gjt.xpp.impl.node.Node |
children, childrenCount, declaredNs, declaredNsEnd, declaredPrefixes, defaultNamespaceUri, EMPTY_ENUMERATION, oneChild, parent, prefix2Ns |
Constructor Summary | |
PullNode(XmlPullParser pp)
|
Method Summary | |
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. |
Methods inherited from class org.gjt.xpp.impl.node.Node |
addDeclaredNamespaces, addNamespaceDeclaration, ensureChildrenCapacity, ensureDeclaredNamespacesCapacity, equals, getDeclaredNamespaceLength, getDefaultNamespaceUri, getParentNode, getQNameLocal, getQNameUri, namespace2Prefix, newNode, prefix2Namespace, readDeclaredNamespaceUris, readDeclaredPrefixes, removeDeclaredNamespaces, resetNode, setDefaultNamespaceUri, setParentNode |
Methods inherited from class org.gjt.xpp.impl.tag.Tag |
getLocalName, getNamespaceUri, getPrefix, getRawName, hashCode, modifyTag, resetTag |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.gjt.xpp.XmlTag |
getLocalName, getNamespaceUri, getPrefix, getRawName, modifyTag, resetTag |
Field Detail |
protected int depth
protected XmlPullParser pp
Constructor Detail |
public PullNode(XmlPullParser pp) throws XmlPullParserException
Method Detail |
public XmlNode newNode() throws XmlPullParserException
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 XmlPullNode
children
in class Node
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
public java.lang.String toString()
toString
in class Node
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |