Interface Node
This is the base interface for DOM nodes, as obtained from using
XMLParser
methods. Methods for iterating over and accessing
values from nodes are supplied here.
Fields
ATTRIBUTE_NODE | The constant 2 denotes DOM nodes of type Attribute. |
CDATA_SECTION_NODE | The constant 4 denotes DOM nodes of type CdataSection. |
COMMENT_NODE | The constant 8 denotes DOM nodes of type Comment. |
DOCUMENT_FRAGMENT_NODE | The constant 11 denotes DOM nodes of type DocumentFragment. |
DOCUMENT_NODE | The constant 9 denotes DOM nodes of type Document. |
DOCUMENT_TYPE_NODE | The constant 10 denotes DOM nodes of type DocumentType. |
ELEMENT_NODE | The constant 1 denotes DOM nodes of type Element. |
ENTITY_NODE | The constant 6 denotes DOM nodes of type Entity. |
ENTITY_REFERENCE_NODE | The constant 5 denotes DOM nodes of type EntityReference. |
NOTATION_NODE | The constant 12 denotes DOM nodes of type Notation. |
PROCESSING_INSTRUCTION_NODE | The constant 7 denotes DOM nodes of type ProcessingInstruction. |
TEXT_NODE | The constant 3 denotes DOM nodes of type Text. |
Methods
Field Detail
ATTRIBUTE_NODE
public static final short ATTRIBUTE_NODE
The constant 2 denotes DOM nodes of type Attribute.
CDATA_SECTION_NODE
public static final short CDATA_SECTION_NODE
The constant 4 denotes DOM nodes of type CdataSection.
COMMENT_NODE
public static final short COMMENT_NODE
The constant 8 denotes DOM nodes of type Comment.
DOCUMENT_FRAGMENT_NODE
public static final short DOCUMENT_FRAGMENT_NODE
The constant 11 denotes DOM nodes of type DocumentFragment.
DOCUMENT_NODE
public static final short DOCUMENT_NODE
The constant 9 denotes DOM nodes of type Document.
DOCUMENT_TYPE_NODE
public static final short DOCUMENT_TYPE_NODE
The constant 10 denotes DOM nodes of type DocumentType.
ELEMENT_NODE
public static final short ELEMENT_NODE
The constant 1 denotes DOM nodes of type Element.
ENTITY_NODE
public static final short ENTITY_NODE
The constant 6 denotes DOM nodes of type Entity.
ENTITY_REFERENCE_NODE
public static final short ENTITY_REFERENCE_NODE
The constant 5 denotes DOM nodes of type EntityReference.
NOTATION_NODE
public static final short NOTATION_NODE
The constant 12 denotes DOM nodes of type Notation.
PROCESSING_INSTRUCTION_NODE
public static final short PROCESSING_INSTRUCTION_NODE
The constant 7 denotes DOM nodes of type ProcessingInstruction.
TEXT_NODE
public static final short TEXT_NODE
The constant 3 denotes DOM nodes of type Text.
Method Detail
appendChild
This method appends child
newChild
.
Parameters
- newChild
- the
Node
to be added
Return Value
the child
Node
appended
cloneNode
public
Node cloneNode(
boolean deep)
This method copies this
Node
.
Parameters
- deep
- whether to recurse to children
Return Value
Node
cloned
getAttributes
This method retrieves the attributes.
Return Value
the attributes of this
Node
getChildNodes
This method retrieves the child nodes.
Return Value
the child nodes of this
Node
getFirstChild
public
Node getFirstChild()
This method retrieves the first child.
Return Value
the first child of this
Node
getLastChild
public
Node getLastChild()
This method retrieves the last child.
Return Value
the last child of this
Node
getNamespaceURI
public
String getNamespaceURI()
This method retrieves the namespace URI.
Return Value
the namespace URI of this
Node
getNextSibling
public
Node getNextSibling()
This method retrieves the next sibling.
Return Value
the next sibling of this
Node
getNodeName
This method retrieves the name.
Return Value
the name of this
Node
getNodeType
public short getNodeType()
This method retrieves the type.
Return Value
the type of this
Node
getNodeValue
This method retrieves the value.
Return Value
the value of this
Node
getOwnerDocument
This method retrieves the owner document.
Return Value
the owner document of this
Node
getParentNode
public
Node getParentNode()
This method retrieves the parent.
Return Value
the parent of this
Node
getPrefix
This method retrieves the prefix.
Return Value
the prefix of this
Node
getPreviousSibling
public
Node getPreviousSibling()
This method retrieves the previous sibling.
Return Value
the previous sibling of this
Node
hasAttributes
public boolean hasAttributes()
This method determines whether this
Node
has any attributes.
Return Value
true
if this
Node
has any attributes
hasChildNodes
public boolean hasChildNodes()
This method determines whether this
Node
has any child
nodes.
Return Value
true
if this
Node
has any child nodes
insertBefore
This method inserts before
newChild
.
Parameters
- newChild
- the
Node
to be added
- refChild
- the
Node
which determines the position to
insert
Return Value
the before
Node
inserted
normalize
public void normalize()
This method may collapse adjacent text nodes into one text node, depending
on the implementation.
removeChild
This method removes child
oldChild
.
Parameters
- oldChild
- the
Node
to be removed
Return Value
the child
Node
removed
replaceChild
This method replaces the child
oldChild
with
newChild
.
Parameters
- newChild
- the
Node
to be added
- oldChild
- the
Node
to be removed
Return Value
the child
Node
replaced
setNodeValue
public void
setNodeValue(
String nodeValue)
This method sets the value to
nodeValue
.
Parameters
- nodeValue
- the new value