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:
- call setDefaultNamespaceUri() to associate default namespace
in which this node is declared
- and to declare additional namespaces (as of xmlns:prefix="...")
with calling first removeNamespaces() and then addNamespaces()
Author: Aleksander Slominski
See Also: XmlStartTag
Method Summary |
void | addDeclaredNamespaces(String[] prefix, int off, int len, String[] namespaceUri)
NOTE: node SHOULD NOT keep references to passed arrays! |
void | addNamespaceDeclaration(String prefix, String namespaceUri) |
void | appendChild(Object child) |
Enumeration | children() |
void | ensureChildrenCapacity(int minCapacity) |
void | ensureDeclaredNamespacesCapacity(int minCapacity) |
Object | getChildAt(int pos) |
int | getChildrenCount() it may need to reconsruct whole subtree to get count ... |
int | getDeclaredNamespaceLength() |
String | getDefaultNamespaceUri() Namesapce URI associated with default namesapce prefix (xmlns='....') |
XmlNode | getParentNode() |
String | getQNameLocal(String qName)
Return local part of qname.
|
String | getQNameUri(String qName)
Return uri part of qname.
|
void | insertChildAt(int pos, Object child) |
String | namespace2Prefix(String namespaceUri) return prefix for namesapce searching node tree upward. |
XmlNode | newNode() context sensitive factory method to create the same type of node |
XmlNode | newNode(String amespaceUri, String localName) |
String | prefix2Namespace(String prefix) return namespace for prefix searching node tree upward. |
void | readDeclaredNamespaceUris(String[] uris, int off, int len) |
void | readDeclaredPrefixes(String[] prefixes, int off, int len) |
void | removeChildAt(int pos) |
void | removeChildren()
Removes all children - every child that was
implementing XmlNode will have set parent to null. |
void | removeDeclaredNamespaces() |
void | replaceChildAt(int pos, Object child) |
void | resetNode()
Clear all Tag state to default values. |
void | setDefaultNamespaceUri(String defaultNamespaceUri) Set default namesapce URI (xmlns='....') |
void | setParentNode(XmlNode parent) |
public void addDeclaredNamespaces(String[] prefix, int off, int len, String[] namespaceUri)
NOTE: node SHOULD NOT keep references to passed arrays!
public void addNamespaceDeclaration(String prefix, String namespaceUri)
public void appendChild(Object child)
public Enumeration children()
public void ensureChildrenCapacity(int minCapacity)
public void ensureDeclaredNamespacesCapacity(int minCapacity)
public Object getChildAt(int pos)
public int getChildrenCount()
it may need to reconsruct whole subtree to get count ...
public int getDeclaredNamespaceLength()
public String getDefaultNamespaceUri()
Namesapce URI associated with default namesapce prefix (xmlns='....')
public String getQNameLocal(String qName)
Return local part of qname.
For example for 'xsi:type' it returns 'type'.
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'.
public void insertChildAt(int pos, Object child)
public String namespace2Prefix(String namespaceUri)
return prefix for namesapce searching node tree upward.
context sensitive factory method to create the same type of node
public
XmlNode newNode(String amespaceUri, String localName)
public String prefix2Namespace(String prefix)
return namespace for prefix searching node tree upward.
public void readDeclaredNamespaceUris(String[] uris, int off, int len)
public void readDeclaredPrefixes(String[] prefixes, int off, int len)
public void removeChildAt(int pos)
public void removeChildren()
Removes all children - every child that was
implementing XmlNode will have set parent to null.
public void removeDeclaredNamespaces()
public void replaceChildAt(int pos, Object child)
public void resetNode()
Clear all Tag state to default values.
public void setDefaultNamespaceUri(String defaultNamespaceUri)
Set default namesapce URI (xmlns='....')
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