java.lang.Object | ||
↳ | com.google.gwt.core.client.JavaScriptObject | |
↳ | com.google.gwt.dom.client.Node |
Known Direct Subclasses |
Known Indirect Subclasses |
The Node interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree. While all objects implementing the Node interface expose methods for dealing with children, not all objects implementing the Node interface may have children.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
short | DOCUMENT_NODE | The node is a Document . |
|||||||||
short | ELEMENT_NODE | The node is an Element . |
|||||||||
short | TEXT_NODE | The node is a Text node. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds the node newChild to the end of the list of children of this node.
| |||||||||||
Assert that the given
JavaScriptObject is a DOM node and
automatically typecast it. | |||||||||||
Returns a duplicate of this node, i.e., serves as a generic copy
constructor for nodes.
| |||||||||||
Gets the child node at the given index.
| |||||||||||
Gets the number of child nodes contained within this node.
| |||||||||||
A NodeList that contains all children of this node.
| |||||||||||
The first child of this node.
| |||||||||||
The last child of this node.
| |||||||||||
The node immediately following this node.
| |||||||||||
The name of this node, depending on its type; see the table above.
| |||||||||||
A code representing the type of the underlying object, as defined above.
| |||||||||||
The value of this node, depending on its type; see the table above.
| |||||||||||
The Document object associated with this node.
| |||||||||||
Gets the parent element of this node.
| |||||||||||
The parent of this node.
| |||||||||||
The node immediately preceding this node.
| |||||||||||
Returns whether this node has any children.
| |||||||||||
Determines whether this node has a parent element.
| |||||||||||
Inserts the node newChild after the existing child node refChild.
| |||||||||||
Inserts the node newChild before the existing child node refChild.
| |||||||||||
Inserts the given child as the first child of this node.
| |||||||||||
Determines whether the given
JavaScriptObject is a DOM node. | |||||||||||
Determine whether a node is equal to, or the child of, this node.
| |||||||||||
Removes the child node indicated by oldChild from the list of children, and
returns it.
| |||||||||||
Removes this node from its parent node if it is attached to one.
| |||||||||||
Replaces the child node oldChild with newChild in the list of children, and
returns the oldChild node.
| |||||||||||
The value of this node, depending on its type; see the table above.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.core.client.JavaScriptObject
| |||||||||||
From class
java.lang.Object
|
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.
newChild | The node to add |
---|
Assert that the given JavaScriptObject
is a DOM node and
automatically typecast it.
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is null.). Cloning an Element copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text node. Cloning an Attribute directly, as opposed to be cloned as part of an Element cloning operation, returns a specified attribute (specified is true). Cloning any other type of node simply returns a copy of this node.
deep | If true, recursively clone the subtree under the specified
node; if false, clone only the node itself (and its attributes, if
it is an Element ) |
---|
Gets the child node at the given index.
index | the index of the node to be retrieved |
---|
Gets the number of child nodes contained within this node.
A NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes.
The first child of this node. If there is no such node, this returns null.
The last child of this node. If there is no such node, this returns null.
The node immediately following this node. If there is no such node, this returns null.
The name of this node, depending on its type; see the table above.
A code representing the type of the underlying object, as defined above.
The value of this node, depending on its type; see the table above. When it is defined to be null, setting it has no effect.
The Document object associated with this node. This is also the
Document
object used to create new nodes.
Gets the parent element of this node.
null
if none exists
The parent of this node. All nodes except Document may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null.
The node immediately preceding this node. If there is no such node, this returns null.
Returns whether this node has any children.
Determines whether this node has a parent element.
Inserts the node newChild after the existing child node refChild. If
refChild is null
, insert newChild at the end of the list of children.
newChild | The node to insert |
---|---|
refChild | The reference node (that is, the node after which the new
node must be inserted), or null |
Inserts the node newChild before the existing child node refChild. If
refChild is null
, insert newChild at the end of the list of children.
newChild | The node to insert |
---|---|
refChild | The reference node (that is, the node before which the new
node must be inserted), or null |
Inserts the given child as the first child of this node.
child | the child to be inserted |
---|
Determines whether the given JavaScriptObject
is a DOM node. A
null
object will cause this method to return
false
.
Determine whether a node is equal to, or the child of, this node.
child | the potential child element |
---|
true
if the relationship holds
Removes the child node indicated by oldChild from the list of children, and returns it.
oldChild | The node being removed |
---|
Removes this node from its parent node if it is attached to one.
Replaces the child node 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 |
The value of this node, depending on its type; see the table above. When it is defined to be null, setting it has no effect.