Xindice API

org.apache.xindice.xml.dom
Class ContainerNodeImpl

java.lang.Object
  |
  +--org.apache.xindice.xml.dom.NodeImpl
        |
        +--org.apache.xindice.xml.dom.ContainerNodeImpl
All Implemented Interfaces:
CompressedNode, DBNode, org.w3c.dom.Node
Direct Known Subclasses:
AttrImpl, DocumentFragmentImpl, DocumentImpl, ElementImpl

public abstract class ContainerNodeImpl
extends NodeImpl

ContainerNodeImpl performs most of the child-rearing behavior of the Element and Document implementations.


Fields inherited from class org.apache.xindice.xml.dom.NodeImpl
EX_DOMSTRING_SIZE, EX_HIERARCHY_REQUEST, EX_INDEX_SIZE, EX_INUSE_ATTRIBUTE, EX_INVALID_STATE, EX_NO_DATA_ALLOWED, EX_NO_MODIFICATION_ALLOWED, EX_NOT_FOUND, EX_WRONG_DOCUMENT, OBJECT_HREF, OBJECT_NS, OBJECT_TYPE, TYPE_APPEND, TYPE_CONTENT, TYPE_INSERT, TYPE_REPLACE, XMLNS_PREFIX
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
ContainerNodeImpl()
           
ContainerNodeImpl(NodeImpl parentNode, boolean dirty)
           
ContainerNodeImpl(NodeImpl parentNode, byte[] data, int pos, int len)
           
 
Method Summary
 org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
          Adds the node newChild to the end of the list of children of this node.
 org.w3c.dom.NodeList getChildNodes()
          A NodeList that contains all children of this node.
 org.w3c.dom.Element getElementById(java.lang.String elementId)
           
 org.w3c.dom.NodeList getElementsByTagName(java.lang.String name)
          Returns a NodeList of all descendant elements with a given tag name, in the order in which they would be encountered in a preorder traversal of the Element tree.
 org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
           
 org.w3c.dom.Node getFirstChild()
          The first child of this node.
 org.w3c.dom.Node getLastChild()
          The last child of this node.
 boolean hasChildNodes()
          This is a convenience method to allow easy determination of whether a node has any children.
 org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
          Inserts the node newChild before the existing child node refChild.
 void normalize()
          Puts all Text nodes in the full depth of the sub-tree underneath this Node , including attribute nodes, into a "normal" form where only markup (e.g., tags, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.
 org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
          Removes the child node indicated by oldChild from the list of children, and returns it.
 org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
          Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
 
Methods inherited from class org.apache.xindice.xml.dom.NodeImpl
checkReadOnly, cloneNode, expandSource, getAttributes, getDataBytes, getDataLen, getDataPos, getKey, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSource, getSymbolID, getUserData, hasAttributes, isDefined, isDirty, isLoaded, isSameNode, isSupported, load, lookupDefaultNamespaceURI, lookupNamespacePrefix, lookupNamespaceURI, normalizeNS, setDataBytes, setDataBytes, setDataLen, setDataPos, setDirty, setNodeName, setNodeValue, setParentNode, setPrefix, setSource, setUserData, unload
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerNodeImpl

public ContainerNodeImpl()

ContainerNodeImpl

public ContainerNodeImpl(NodeImpl parentNode,
                         byte[] data,
                         int pos,
                         int len)

ContainerNodeImpl

public ContainerNodeImpl(NodeImpl parentNode,
                         boolean dirty)
Method Detail

hasChildNodes

public final boolean hasChildNodes()
This is a convenience method to allow easy determination of whether a node has any children.
Overrides:
hasChildNodes in class NodeImpl
Returns:
true if the node has any children, false if the node has no children.

getChildNodes

public final org.w3c.dom.NodeList getChildNodes()
Description copied from class: NodeImpl
A NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes. The content of the returned NodeList is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList accessors; it is not a static snapshot of the content of the node. This is true for every NodeList, including the ones returned by the getElementsByTagName method.
Overrides:
getChildNodes in class NodeImpl

getFirstChild

public final org.w3c.dom.Node getFirstChild()
The first child of this node. If there is no such node, this returns null.
Overrides:
getFirstChild in class NodeImpl

getLastChild

public final org.w3c.dom.Node getLastChild()
The last child of this node. If there is no such node, this returns null.
Overrides:
getLastChild in class NodeImpl

replaceChild

public final org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
                                           org.w3c.dom.Node oldChild)
                                    throws org.w3c.dom.DOMException
Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If the newChild is already in the tree, it is first removed.
Overrides:
replaceChild in class NodeImpl
Parameters:
newChild - The new node to put in the child list.
oldChild - The node being replaced in the list.
Returns:
The node replaced.
Throws:
org.w3c.dom.DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or it the node to put in is one of this node's ancestors.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.

insertBefore

public final org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild,
                                           org.w3c.dom.Node refChild)
                                    throws org.w3c.dom.DOMException
Inserts the node newChild before the existing child node refChild. If refChild is null, insert newChild at the end of the list of children.
If newChild is a DocumentFragment object, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.
Overrides:
insertBefore in class NodeImpl
Parameters:
newChild - The node to insert.
refChild - The reference node, i.e., the node before which the new node must be inserted.
Returns:
The node being inserted.
Throws:
org.w3c.dom.DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if refChild is not a child of this node.

removeChild

public final org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
                                   throws org.w3c.dom.DOMException
Removes the child node indicated by oldChild from the list of children, and returns it.
Overrides:
removeChild in class NodeImpl
Parameters:
oldChild - The node being removed.
Returns:
The node removed.
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.

appendChild

public final org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
                                   throws org.w3c.dom.DOMException
Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed.
Overrides:
appendChild in class NodeImpl
Parameters:
newChild - The node to add.If it is a DocumentFragment object, the entire contents of the document fragment are moved into the child list of this node
Returns:
The node added.
Throws:
org.w3c.dom.DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

normalize

public final void normalize()
Puts all Text nodes in the full depth of the sub-tree underneath this Node , including attribute nodes, into a "normal" form where only markup (e.g., tags, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer lookups) that depend on a particular document tree structure are to be used. In cases where the document contains CDATASections , the normalize operation alone may not be sufficient, since XPointers do not differentiate between Text nodes and CDATASection nodes.
Overrides:
normalize in class NodeImpl
Since:
DOM Level 2

getElementsByTagName

public final org.w3c.dom.NodeList getElementsByTagName(java.lang.String name)
Returns a NodeList of all descendant elements with a given tag name, in the order in which they would be encountered in a preorder traversal of the Element tree.
Parameters:
name - The name of the tag to match on. The special value "*" matches all tags.
Returns:
A list of matching Element nodes.

getElementsByTagNameNS

public final org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI,
                                                         java.lang.String localName)

getElementById

public final org.w3c.dom.Element getElementById(java.lang.String elementId)

Xindice API

Copyright (c) 1999-2001 The Apache Software Foundation