|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.Node
public class Node
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. For example, Text
nodes may not have
children, and adding children to such nodes results in a
DOMException
being raised.
The attributes nodeName
, nodeValue
and attributes
are included as a mechanism to get at
node information without casting down to the specific derived
interface. In cases where there is no obvious mapping of these
attributes for a specific nodeType
(e.g.,
nodeValue
for an Element or attributes
for a
Comment), this returns null
. Note that the
specialized interfaces may contain additional and more convenient
mechanisms to get and set the relevant information.
Constructor Summary | |
---|---|
|
Node()
|
protected |
Node(java.lang.Class dummy)
|
|
Node(Node other)
|
Method Summary | |
---|---|
void |
addEventListener(java.lang.String type,
EventListener listener,
boolean useCapture)
Introduced in DOM Level 2 This method is from the EventTarget interface This method allows the registration of event listeners on the event target. |
Node |
appendChild(Node newChild)
Adds the node newChild to the end of the list of
children of this node. |
void |
applyChanges()
|
NamedNodeMap |
attributes()
A NamedNodeMap containing the attributes of this
node (if it is an Element ) or null
otherwise. |
java.util.ArrayList |
childNodes()
A ArrayList that contains all children of this
node. |
Node |
cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
boolean |
dispatchEvent(Event evt)
Introduced in DOM Level 2 This method is from the EventTarget interface This method allows the dispatch of events into the implementations event model. |
int |
elementId()
not part of the DOM. |
Node |
firstChild()
The first child of this node. |
org.kde.qt.QRect |
getRect()
not part of the DOM. |
boolean |
hasAttributes()
Returns whether this node (if it is an element) has any attributes. |
boolean |
hasChildNodes()
This is a convenience method to allow easy determination of whether a node has any children. |
long |
index()
|
Node |
insertBefore(Node newChild,
Node refChild)
Inserts the node newChild before the existing
child node refChild . |
boolean |
isNull()
tests if this Node is 0. |
boolean |
isSupported(java.lang.String feature,
java.lang.String version)
Introduced in DOM Level 2 Tests whether the DOM implementation implements a specific feature and that feature is supported by this node. |
Node |
lastChild()
The last child of this node. |
java.lang.String |
localName()
Introduced in DOM Level 2 Returns the local part of the qualified name of this node. |
java.lang.String |
namespaceURI()
Introduced in DOM Level 2 The namespace URI of this node, or null if it is unspecified. |
Node |
nextSibling()
The node immediately following this node. |
java.lang.String |
nodeName()
The name of this node, depending on its type; see the table above. |
short |
nodeType()
A code representing the type of the underlying object, as defined above. |
java.lang.String |
nodeValue()
The value of this node, depending on its type; see the table above. |
void |
normalize()
Modified in DOM Level 2 Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes. |
boolean |
op_equals(Node other)
|
boolean |
op_not_equals(Node other)
|
Document |
ownerDocument()
The Document object associated with this node. |
Node |
parentNode()
The parent of this node. |
java.lang.String |
prefix()
Introduced in DOM Level 2 The namespace prefix of this node, or null if it is unspecified. |
Node |
previousSibling()
The node immediately preceding this node. |
Node |
removeChild(Node oldChild)
Removes the child node indicated by oldChild
from the list of children, and returns it. |
void |
removeEventListener(java.lang.String type,
EventListener listener,
boolean useCapture)
Introduced in DOM Level 2 This method is from the EventTarget interface This method allows the removal of event listeners from the event target. |
Node |
replaceChild(Node newChild,
Node oldChild)
Replaces the child node oldChild with
newChild in the list of children, and returns the
oldChild node. |
void |
setNodeValue(java.lang.String arg1)
see nodeValue |
void |
setPrefix(java.lang.String prefix)
see prefix NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Node(java.lang.Class dummy)
public Node()
public Node(Node other)
Method Detail |
---|
public boolean op_equals(Node other)
public boolean op_not_equals(Node other)
public java.lang.String nodeName()
public java.lang.String nodeValue()
public void setNodeValue(java.lang.String arg1)
public short nodeType()
public Node parentNode()
Document
, DocumentFragment
, and Attr
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
.
public java.util.ArrayList childNodes()
ArrayList
that contains all children of this
node. If there are no children, this is a ArrayList
containing no nodes. The content of the returned
ArrayList
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 ArrayList
accessors; it is not a
static snapshot of the content of the node. This is true for
every ArrayList
, including the ones returned by
the getElementsByTagName
method.
public Node firstChild()
null
.
public Node lastChild()
null
.
public Node previousSibling()
null
.
public Node nextSibling()
null
.
public NamedNodeMap attributes()
NamedNodeMap
containing the attributes of this
node (if it is an Element
) or null
otherwise.
public Document ownerDocument()
Document
object associated with this node.
This is also the Document
object used to create
new nodes. When this node is a Document
this is
null
.
public Node insertBefore(Node newChild, Node refChild)
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.
newChild
- The node to insert.refChild
- The reference node, i.e., the node before which
the new node must be inserted.
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.
public Node replaceChild(Node newChild, Node oldChild)
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.
newChild
- The new node to put in the child list.oldChild
- The node being replaced in the list.
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.
public Node removeChild(Node oldChild)
oldChild
from the list of children, and returns it.
oldChild
- The node being removed.
NOT_FOUND_ERR: Raised if oldChild
is not a
child of this node.
public Node appendChild(Node newChild)
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.
If it is a DocumentFragment
object, the entire
contents of the document fragment are moved into the child list
of this node
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.
public boolean hasChildNodes()
true
if the node has any children,
false
if the node has no children.public Node cloneNode(boolean deep)
parentNode
returns 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 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
).
public void normalize()
public boolean isSupported(java.lang.String feature, java.lang.String version)
feature
- The name of the feature to test. This is the same name
which can be passed to the method hasFeature on DOMImplementation.version
- This is the version number of the feature to test. In
Level 2, version 1, this is the string "2.0". If the version is not
specified, supporting any version of the feature will cause the method
to return true.
public java.lang.String namespaceURI()
public java.lang.String prefix()
public void setPrefix(java.lang.String prefix)
public java.lang.String localName()
public boolean hasAttributes()
public void addEventListener(java.lang.String type, EventListener listener, boolean useCapture)
type
- The event type for which the user is registeringlistener
- The listener parameter takes an interface implemented by
the user which contains the methods to be called when the event occurs.useCapture
- If true, useCapture indicates that the user wishes to
initiate capture. After initiating capture, all events of the specified
type will be dispatched to the registered EventListener before being
dispatched to any EventTargets beneath them in the tree. Events which
are bubbling upward through the tree will not trigger an EventListener
designated to use capture.public void removeEventListener(java.lang.String type, EventListener listener, boolean useCapture)
type
- Specifies the event type of the EventListener being removed.listener
- The EventListener parameter indicates the EventListener
to be removed.useCapture
- Specifies whether the EventListener being removed was
registered as a capturing listener or not. If a listener was registered
twice, one with capture and one without, each must be removed
separately. Removal of a capturing listener does not affect a
non-capturing version of the same listener, and vice versa.public boolean dispatchEvent(Event evt)
evt
- Specifies the event type, behavior, and contextual
information to be used in processing the event.
public int elementId()
public boolean isNull()
Node n = .....; // try to convert into an Element: Element e = n; if( e.isNull() ) kdDebug(300) << "node isn't an element node" << endl;
public long index()
public void applyChanges()
public org.kde.qt.QRect getRect()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |