org.gjt.xpp.impl.pullnode

Class PullNode

Implemented Interfaces:
XmlNode, XmlPullNode, XmlStartTag, XmlTag

public class PullNode
extends Node
implements XmlPullNode

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...
Author:
Aleksander Slominski

Field Summary

protected int
depth
protected XmlPullParser
pp

Fields inherited from class org.gjt.xpp.impl.node.Node

EMPTY_ENUMERATION, children, childrenCount, declaredNs, declaredNsEnd, declaredPrefixes, defaultNamespaceUri, oneChild, parent, prefix2Ns

Constructor Summary

PullNode(XmlPullParser pp)

Method Summary

void
appendChild(Object child)
Enumeration
children()
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()
void
insertChildAt(int pos, Object child)
boolean
isFinished()
XmlNode
newNode()
XmlPullNode
newPullNode(XmlPullParser pp)
protected void
printFields(StringBuffer buf)
Print this class state into StringBuffer element name
void
readChildren()
Read all reminaing children up to end tag.
Object
readNextChild()
void
removeChildAt(int pos)
void
removeChildren()
void
replaceChildAt(int pos, Object child)
void
resetPullNode()
PullNode stays in finished state.
void
setPullParser(XmlPullParser pp)
Reset pull node to use pull parser.
void
skipChildren()
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, appendChild, children, ensureChildrenCapacity, ensureDeclaredNamespacesCapacity, equals, getChildAt, getChildrenCount, getDeclaredNamespaceLength, getDefaultNamespaceUri, getParentNode, getQNameLocal, getQNameUri, insertChildAt, namespace2Prefix, newNode, newNode, prefix2Namespace, printFields, readDeclaredNamespaceUris, readDeclaredPrefixes, removeChildAt, removeChildren, removeDeclaredNamespaces, replaceChildAt, resetNode, setDefaultNamespaceUri, setParentNode, toString

Methods inherited from class org.gjt.xpp.impl.tag.StartTag

addAttribute, addAttribute, ensureAttributesCapacity, equals, getAttributeCount, getAttributeLocalName, getAttributeNamespaceUri, getAttributePrefix, getAttributeRawName, getAttributeValue, getAttributeValueFromName, getAttributeValueFromRawName, isAttributeNamespaceDeclaration, printFields, removeAttributeByName, removeAttributeByRawName, removeAttributes, resetStartTag, toString

Methods inherited from class org.gjt.xpp.impl.tag.Tag

equals, getLocalName, getNamespaceUri, getPrefix, getRawName, hashCode, modifyTag, printFields, resetTag

Field Details

depth

protected int depth

pp

protected XmlPullParser pp

Constructor Details

PullNode

public PullNode(XmlPullParser pp)
            throws XmlPullParserException

Method Details

appendChild

public void appendChild(Object child)
            throws XmlPullParserException
Specified by:
appendChild in interface XmlNode
Overrides:
appendChild in interface Node

children

public Enumeration children()
Specified by:
children in interface XmlPullNode
children in interface XmlNode
Overrides:
children in interface Node

getChildAt

public Object getChildAt(int pos)
Specified by:
getChildAt in interface XmlNode
Overrides:
getChildAt in interface Node

getChildrenCount

public int getChildrenCount()
it will reconsruct whole subtree to get count ...
Specified by:
getChildrenCount in interface XmlNode
Overrides:
getChildrenCount in interface Node

getChildrenCountSoFar

public int getChildrenCountSoFar()
if unfinished it returns actual number of children...
Specified by:
getChildrenCountSoFar in interface XmlPullNode

getPullParser

public XmlPullParser getPullParser()
            throws IOException,
                   XmlPullParserException
Specified by:
getPullParser in interface XmlPullNode

insertChildAt

public void insertChildAt(int pos,
                          Object child)
            throws XmlPullParserException
Specified by:
insertChildAt in interface XmlNode
Overrides:
insertChildAt in interface Node

isFinished

public boolean isFinished()
Specified by:
isFinished in interface XmlPullNode

newNode

public XmlNode newNode()
            throws XmlPullParserException
Specified by:
newNode in interface XmlPullNode
newNode in interface XmlNode
Overrides:
newNode in interface Node

newPullNode

public XmlPullNode newPullNode(XmlPullParser pp)
            throws XmlPullParserException
Specified by:
newPullNode in interface XmlPullNode

printFields

protected void printFields(StringBuffer buf)
Print this class state into StringBuffer element name
Overrides:
printFields in interface Node

readChildren

public void readChildren()
            throws XmlPullParserException,
                   IOException
Read all reminaing children up to end tag.
Specified by:
readChildren in interface XmlPullNode

readNextChild

public Object readNextChild()
            throws XmlPullParserException,
                   IOException
Specified by:
readNextChild in interface XmlPullNode

removeChildAt

public void removeChildAt(int pos)
            throws XmlPullParserException
Specified by:
removeChildAt in interface XmlNode
Overrides:
removeChildAt in interface Node

removeChildren

public void removeChildren()
            throws XmlPullParserException
Specified by:
removeChildren in interface XmlNode
Overrides:
removeChildren in interface Node

replaceChildAt

public void replaceChildAt(int pos,
                           Object child)
            throws XmlPullParserException
Specified by:
replaceChildAt in interface XmlNode
Overrides:
replaceChildAt in interface Node

resetPullNode

public void resetPullNode()
PullNode stays in finished state.
Specified by:
resetPullNode in interface XmlPullNode

setPullParser

public void setPullParser(XmlPullParser pp)
            throws XmlPullParserException
Reset pull node to use pull parser. Pull Parser must be on START_TAG
Specified by:
setPullParser in interface XmlPullNode

skipChildren

public void skipChildren()
            throws XmlPullParserException,
                   IOException
Specified by:
skipChildren in interface XmlPullNode

toString

public String toString()
Return string representation of start tag including name and list of attributes.
Overrides:
toString in interface 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