org.gjt.xpp

Interface XmlNode

public interface XmlNode extends XmlStartTag

This class represents XML subtree. XmlNode is extension of XmlStartTag adding support for children (some of them may be also XmlNode so we get recursively built tree) and namespaces declarations associated with this node. When node has no children and namespaces declared it is essentially equivalent to XmlStartTag.

When XmlNode user does not need namespaces then namespace related methods may be ignored. However to use namespaces it is required to:

Author: Aleksander Slominski

See Also: XmlStartTag

Method Summary
voidaddDeclaredNamespaces(String[] prefix, int off, int len, String[] namespaceUri)
NOTE: node SHOULD NOT keep references to passed arrays!
voidaddNamespaceDeclaration(String prefix, String namespaceUri)
voidappendChild(Object child)
Enumerationchildren()
voidensureChildrenCapacity(int minCapacity)
voidensureDeclaredNamespacesCapacity(int minCapacity)
ObjectgetChildAt(int pos)
intgetChildrenCount()
it may need to reconsruct whole subtree to get count ...
intgetDeclaredNamespaceLength()
StringgetDefaultNamespaceUri()
Namesapce URI associated with default namesapce prefix (xmlns='....')
XmlNodegetParentNode()
StringgetQNameLocal(String qName)
Return local part of qname.
StringgetQNameUri(String qName)
Return uri part of qname.
voidinsertChildAt(int pos, Object child)
Stringnamespace2Prefix(String namespaceUri)
return prefix for namesapce searching node tree upward.
XmlNodenewNode()
context sensitive factory method to create the same type of node
XmlNodenewNode(String amespaceUri, String localName)
Stringprefix2Namespace(String prefix)
return namespace for prefix searching node tree upward.
voidreadDeclaredNamespaceUris(String[] uris, int off, int len)
voidreadDeclaredPrefixes(String[] prefixes, int off, int len)
voidremoveChildAt(int pos)
voidremoveChildren()
Removes all children - every child that was implementing XmlNode will have set parent to null.
voidremoveDeclaredNamespaces()
voidreplaceChildAt(int pos, Object child)
voidresetNode()
Clear all Tag state to default values.
voidsetDefaultNamespaceUri(String defaultNamespaceUri)
Set default namesapce URI (xmlns='....')
voidsetParentNode(XmlNode parent)

Method Detail

addDeclaredNamespaces

public void addDeclaredNamespaces(String[] prefix, int off, int len, String[] namespaceUri)
NOTE: node SHOULD NOT keep references to passed arrays!

addNamespaceDeclaration

public void addNamespaceDeclaration(String prefix, String namespaceUri)

appendChild

public void appendChild(Object child)

children

public Enumeration children()

ensureChildrenCapacity

public void ensureChildrenCapacity(int minCapacity)

ensureDeclaredNamespacesCapacity

public void ensureDeclaredNamespacesCapacity(int minCapacity)

getChildAt

public Object getChildAt(int pos)

getChildrenCount

public int getChildrenCount()
it may need to reconsruct whole subtree to get count ...

getDeclaredNamespaceLength

public int getDeclaredNamespaceLength()

getDefaultNamespaceUri

public String getDefaultNamespaceUri()
Namesapce URI associated with default namesapce prefix (xmlns='....')

getParentNode

public XmlNode getParentNode()

getQNameLocal

public String getQNameLocal(String qName)
Return local part of qname. For example for 'xsi:type' it returns 'type'.

getQNameUri

public String getQNameUri(String qName)
Return uri part of qname. The return value is dependent on declared namespaces in this node and possible when looking for value in parent node. For example for 'xsi:type' if xsi namespace prefix was declared to 'http://foo' it will return 'http://foo'.

insertChildAt

public void insertChildAt(int pos, Object child)

namespace2Prefix

public String namespace2Prefix(String namespaceUri)
return prefix for namesapce searching node tree upward.

newNode

public XmlNode newNode()
context sensitive factory method to create the same type of node

newNode

public XmlNode newNode(String amespaceUri, String localName)

prefix2Namespace

public String prefix2Namespace(String prefix)
return namespace for prefix searching node tree upward.

readDeclaredNamespaceUris

public void readDeclaredNamespaceUris(String[] uris, int off, int len)

readDeclaredPrefixes

public void readDeclaredPrefixes(String[] prefixes, int off, int len)

removeChildAt

public void removeChildAt(int pos)

removeChildren

public void removeChildren()
Removes all children - every child that was implementing XmlNode will have set parent to null.

removeDeclaredNamespaces

public void removeDeclaredNamespaces()

replaceChildAt

public void replaceChildAt(int pos, Object child)

resetNode

public void resetNode()
Clear all Tag state to default values.

setDefaultNamespaceUri

public void setDefaultNamespaceUri(String defaultNamespaceUri)
Set default namesapce URI (xmlns='....')

setParentNode

public void setParentNode(XmlNode parent)
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