public interface DOMNode extends DOMEventTarget
| Modifier and Type | Field and Description |
|---|---|
static int |
ELEMENT |
static int |
FRAME |
static int |
IFRAME |
static int |
TEXT |
| Modifier and Type | Method and Description |
|---|---|
DOMNode |
appendChild(DOMNode newChild)
Adds the node
newChild to the end of the list of children
of this node. |
DOMNamedNodeMap |
getAttributes()
Returns a
DOMNamedNodeMap containing the attributes of this node (if
it is an DOMElement) or null otherwise. |
DOMNodeList |
getChildNodes()
Returns list of child nodes of this node.
|
DOMDocument |
getDocument()
Returns the
DOMDocument object associated with this node. |
DOMNode |
getFirstChild()
Returns first child of this node or
null when it doesn't have children. |
DOMNode |
getLastChild()
Returns last child of this node or
null when it doesn't have children. |
DOMNode |
getNextSibling()
Returns the node immediately following this node.
|
java.lang.String |
getNodeName()
Returns the name of this node, depending on its type.
|
DOMNodeType |
getNodeType()
Returns a code representing the type of the node.
|
java.lang.String |
getNodeValue()
Returns the value of this node, depending on its type.
|
DOMNode |
getParentNode()
Returns parent
DOMNode or null if the node doesn't have parent. |
DOMNode |
getPreviousSibling()
Returns the node immediately preceding this node.
|
java.lang.String |
getTextContent()
Returns the text content of this node and its descendants.
|
boolean |
hasAttributes()
Returns whether this node (if it is an element) has any attributes.
|
boolean |
hasChildNodes()
Returns whether this node has any children.
|
DOMNode |
insertBefore(DOMNode newChild,
DOMNode refChild)
Inserts the node
newChild before the existing child node
refChild. |
boolean |
isEqualNode(DOMNode arg)
Tests whether two nodes are equal.
|
boolean |
isSameNode(DOMNode other)
Returns whether this node is the same node as the given one.
|
DOMNode |
removeChild(DOMNode oldChild)
Removes the child node indicated by
oldChild from the list
of children, and returns it. |
DOMNode |
replaceChild(DOMNode newChild,
DOMNode oldChild)
Replaces the child node
oldChild with newChild
in the list of children, and returns the oldChild node. |
void |
setNodeValue(java.lang.String nodeValue)
Sets a new value for this node.
|
void |
setTextContent(java.lang.String textContent)
Sets
textContent of this node. |
addEventListener, removeEventListenerstatic final int ELEMENT
static final int TEXT
static final int FRAME
static final int IFRAME
java.lang.String getNodeName()
java.lang.String getNodeValue()
void setNodeValue(java.lang.String nodeValue)
nodeValue - new node value.DOMNodeType getNodeType()
null if type is unknown.DOMNode getParentNode()
DOMNode or null if the node doesn't have parent.DOMNode or null if the node doesn't have parent.DOMNodeList getChildNodes()
DOMNode getFirstChild()
null when it doesn't have children.null when it doesn't have children.DOMNode getLastChild()
null when it doesn't have children.null when it doesn't have children.DOMNode getPreviousSibling()
null.DOMNode getNextSibling()
null.DOMNamedNodeMap getAttributes()
DOMNamedNodeMap containing the attributes of this node (if
it is an DOMElement) or null otherwise.DOMNamedNodeMap containing the attributes of this node.DOMDocument getDocument()
DOMDocument object associated with this node.DOMDocument object associated with this node.DOMNode insertBefore(DOMNode newChild, DOMNode refChild)
newChild before the existing child node
refChild.newChild - the node to insert.refChild - the reference node, i.e., the node before which the
new node must be inserted.DOMNode replaceChild(DOMNode newChild, DOMNode oldChild)
oldChild with newChild
in the list of children, and returns the oldChild node.newChild - the new node to put in the child list.oldChild - the node being replaced in the list.DOMNode removeChild(DOMNode oldChild)
oldChild from the list
of children, and returns it.oldChild - the node being removed.DOMNode appendChild(DOMNode newChild)
newChild to the end of the list of children
of this node.newChild - the node to add.boolean hasChildNodes()
true if this node has any children,
false otherwise.boolean hasAttributes()
true if this node has any attributes,
false otherwise.java.lang.String getTextContent()
void setTextContent(java.lang.String textContent)
textContent of this node.textContent - the text content to set.boolean isSameNode(DOMNode other)
other - The node to test against.true if the nodes are the same,
false otherwise.boolean isEqualNode(DOMNode arg)
arg - the node to compare equality with.true if the nodes are equal,
false otherwise.