|
Xindice API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xindice.xml.dom.NodeImpl | +--org.apache.xindice.xml.dom.ContainerNodeImpl
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 |
public ContainerNodeImpl()
public ContainerNodeImpl(NodeImpl parentNode, byte[] data, int pos, int len)
public ContainerNodeImpl(NodeImpl parentNode, boolean dirty)
Method Detail |
public final boolean hasChildNodes()
hasChildNodes
in class NodeImpl
true
if the node has any children,
false
if the node has no children.public final org.w3c.dom.NodeList getChildNodes()
NodeImpl
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.getChildNodes
in class NodeImpl
public final org.w3c.dom.Node getFirstChild()
null
.getFirstChild
in class NodeImpl
public final org.w3c.dom.Node getLastChild()
null
.getLastChild
in class NodeImpl
public final org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
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.replaceChild
in class NodeImpl
newChild
- The new node to put in the child list.oldChild
- The node being replaced in the list.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.
newChild
was created
from a different document than the one that created this node.
oldChild
is not a child of
this node.public final org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild) throws org.w3c.dom.DOMException
newChild
before the existing child node
refChild
. If refChild
is null
,
insert newChild
at the end of the list of children.
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.insertBefore
in class NodeImpl
newChild
- The node to insert.refChild
- The reference node, i.e., the node before which the new
node must be inserted.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.
newChild
was created
from a different document than the one that created this node.
refChild
is not a child of
this node.public final org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
oldChild
from the list
of children, and returns it.removeChild
in class NodeImpl
oldChild
- The node being removed.org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
oldChild
is not a child of
this node.public final org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws org.w3c.dom.DOMException
newChild
to the end of the list of children of
this node. If the newChild
is already in the tree, it is
first removed.appendChild
in class NodeImpl
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 nodeorg.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.
newChild
was created
from a different document than the one that created this node.
public final void normalize()
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.normalize
in class NodeImpl
public final org.w3c.dom.NodeList getElementsByTagName(java.lang.String name)
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.name
- The name of the tag to match on. The special value "*"
matches all tags.Element
nodes.public final org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
public final org.w3c.dom.Element getElementById(java.lang.String elementId)
|
Xindice API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |