|
EAF 7.6 Util | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.xml.NodeImpl
public class NodeImpl
Namespaces are ignored in this implementation. The terms "tag name" and "node name" are always considered to be synonymous.
Field Summary | |
---|---|
protected NodeImpl |
firstChild
The first (leftmost) child node of this node, or null if this node is a leaf node. |
protected NodeImpl |
lastChild
The last (rightmost) child node of this node, or null if this node is a leaf node. |
protected NodeImpl |
nextSibling
The next (right) sibling node of this node, or null if this node is its parent's last child node. |
protected java.lang.String |
nodeName
The name (tag) of the node as a String . |
protected java.lang.String |
nodeValue
The value of the node as a String . |
protected int |
numChildren
The number of child nodes. |
protected org.w3c.dom.Document |
ownerDocument
Owner document. |
protected NodeImpl |
parent
The parent node of this node, or null if this node
forms the root of its own tree. |
protected NodeImpl |
previousSibling
The previous (left) sibling node of this node, or null if this node is its parent's first child node. |
protected short |
type
The type of the node as a short . |
Fields inherited from interface org.w3c.dom.Node |
---|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Constructor Summary | |
---|---|
NodeImpl()
Constructs an empty NodeImpl . |
|
NodeImpl(org.w3c.dom.Document ownerDoc,
java.lang.String name)
Constructs a NodeImpl from the given document owner and node name. |
|
NodeImpl(org.w3c.dom.Document ownerDoc,
java.lang.String nodeName,
short type)
Constructs an NodeImpl from a given document owner,
node name and node type. |
|
NodeImpl(org.w3c.dom.Document ownerDoc,
java.lang.String nodeName,
short type,
java.lang.String value)
Constructs an NodeImpl from a given document owner,
node name, node type and node value. |
|
NodeImpl(org.w3c.dom.Node node)
Constructs an NodeImpl from a given node (creates the children subtree too),
as a Node |
|
NodeImpl(org.w3c.dom.Node node,
boolean deep)
Constructs an NodeImpl from a given node, as a Node ,
and deep as boolean . |
|
NodeImpl(NodeImpl node)
Constructs a NodeImpl from the given node,
without creating entire children subtree. |
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. |
protected void |
beginToString(java.lang.StringBuffer sb,
Indent indent)
Method beginToString should be redefined in extended classes. |
org.w3c.dom.Node |
cloneNode(boolean deep)
Returns a duplicate of this node. |
short |
compareDocumentPosition(org.w3c.dom.Node arg0)
|
protected void |
endToString(java.lang.StringBuffer sb,
Indent indent)
Method endToString should be redefined in extended classes. |
org.w3c.dom.NamedNodeMap |
getAttributes()
Returns all attribute nodes of this node. |
java.lang.String |
getBaseURI()
|
org.w3c.dom.NodeList |
getChildNodes()
Returns all child nodes of this node, or null if
the node has no children. |
java.lang.Object |
getFeature(java.lang.String arg0,
java.lang.String arg1)
|
org.w3c.dom.Node |
getFirstChild()
Returns the first child of this node, or null if
the node has no children. |
org.w3c.dom.Node |
getLastChild()
Returns the last child of this node, or null if
the node has no children. |
int |
getLength()
Returns number of child nodes. |
java.lang.String |
getLocalName()
Equivalent to getNodeName . |
java.lang.String |
getNamespaceURI()
|
org.w3c.dom.Node |
getNextSibling()
Returns the next sibling of this node, or null if
the node has no next sibling. |
java.lang.String |
getNodeName()
Returns the name associated with this node. |
short |
getNodeType()
Returns the node type. |
java.lang.String |
getNodeValue()
Returns the value associated with this node. |
org.w3c.dom.Document |
getOwnerDocument()
Returns null , since NodeImpl s
do not belong to any Document . |
org.w3c.dom.Node |
getParentNode()
Returns the parent of this node. |
java.lang.String |
getPrefix()
Returns null , since namespaces are not supported. |
org.w3c.dom.Node |
getPreviousSibling()
Returns the previous sibling of this node, or null
if this node has no previous sibling. |
java.lang.String |
getTextContent()
|
java.lang.Object |
getUserData(java.lang.String arg0)
|
boolean |
hasAttributes()
Returns true , if this node has attributes, otherwise
false . |
boolean |
hasChildNodes()
Returns true if this node has child nodes. |
protected void |
initNodeImplChildren(org.w3c.dom.Node node)
Creates the children subtree and adds to this node. |
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 . |
boolean |
isDefaultNamespace(java.lang.String arg0)
|
boolean |
isEqualNode(org.w3c.dom.Node arg0)
|
boolean |
isSameNode(org.w3c.dom.Node arg0)
|
boolean |
isSupported(java.lang.String feature,
java.lang.String version)
Returns false since DOM features are not
supported. |
org.w3c.dom.Node |
item(int index)
Returns child node with the given index. |
java.lang.String |
lookupNamespaceURI(java.lang.String arg0)
|
java.lang.String |
lookupPrefix(java.lang.String arg0)
|
protected org.w3c.dom.Node |
newCommentInstance(org.w3c.dom.Node node)
Creates new instance of the CommentImpl class. |
protected org.w3c.dom.Node |
newDefaultInstance(org.w3c.dom.Node node)
Creates new instance of the NodeImpl class. |
protected org.w3c.dom.Node |
newElementInstance(org.w3c.dom.Node node)
Creates new instance of the ElementImpl class. |
protected org.w3c.dom.Node |
newTextInstance(org.w3c.dom.Node node)
Creates new instance of the TextImpl class. |
void |
normalize()
Does nothing, since NodeImpl s do not
contain Text children. |
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. |
void |
setNodeValue(java.lang.String nodeValue)
Sets the node value of this node. |
void |
setPrefix(java.lang.String prefix)
Does nothing, since namespaces are not supported. |
void |
setTextContent(java.lang.String arg0)
|
java.lang.Object |
setUserData(java.lang.String arg0,
java.lang.Object arg1,
org.w3c.dom.UserDataHandler arg2)
|
java.lang.String |
toString()
Returns String representation of this node. |
java.lang.String |
toString(java.lang.String tab)
Returns String representation of this node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected org.w3c.dom.Document ownerDocument
protected java.lang.String nodeName
String
.
protected java.lang.String nodeValue
String
.
protected short type
short
.
protected NodeImpl parent
null
if this node
forms the root of its own tree.
protected int numChildren
protected NodeImpl firstChild
null
if this node is a leaf node.
protected NodeImpl lastChild
null
if this node is a leaf node.
protected NodeImpl nextSibling
null
if this node is its parent's last child node.
protected NodeImpl previousSibling
null
if this node is its parent's first child node.
Constructor Detail |
---|
public NodeImpl()
NodeImpl
.
public NodeImpl(NodeImpl node)
NodeImpl
from the given node,
without creating entire children subtree.
node,
- as a NodeImpl
.public NodeImpl(org.w3c.dom.Node node)
NodeImpl
from a given node (creates the children subtree too),
as a Node
node,
- as a Node
.public NodeImpl(org.w3c.dom.Node node, boolean deep)
NodeImpl
from a given node, as a Node
,
and deep as boolean
.
node,
- as a Node
.deep
- if true
, recursively clone the subtree
under the specified node; if false
, clone only the
node itself.public NodeImpl(org.w3c.dom.Document ownerDoc, java.lang.String name)
NodeImpl
from the given document owner and node name.
ownerDoc
- the document owner of the node, as a Document
.name
- the name of the node, as a String
.public NodeImpl(org.w3c.dom.Document ownerDoc, java.lang.String nodeName, short type)
NodeImpl
from a given document owner,
node name and node type.
ownerDoc
- the document owner of the node, as a Document
.nodeName
- the name of the node, as a String
.type
- the type of the node, as a short
.public NodeImpl(org.w3c.dom.Document ownerDoc, java.lang.String nodeName, short type, java.lang.String value)
NodeImpl
from a given document owner,
node name, node type and node value.
ownerDoc
- the document owner of the node, as a Document
.nodeName
- the name of the node, as a String
.type
- the type of the node, as a short
.value
- the value of the node, as a String
.Method Detail |
---|
protected void initNodeImplChildren(org.w3c.dom.Node node)
nodeas
- a Node
.protected org.w3c.dom.Node newElementInstance(org.w3c.dom.Node node)
node,
- as a Node
.
protected org.w3c.dom.Node newTextInstance(org.w3c.dom.Node node)
node,
- as a Node
.
protected org.w3c.dom.Node newCommentInstance(org.w3c.dom.Node node)
node,
- as a Node
.
protected org.w3c.dom.Node newDefaultInstance(org.w3c.dom.Node node)
node,
- as a Node
.
public java.lang.String getNodeName()
getNodeName
in interface org.w3c.dom.Node
String
.public java.lang.String getNodeValue()
getNodeValue
in interface org.w3c.dom.Node
String
.public void setNodeValue(java.lang.String nodeValue)
setNodeValue
in interface org.w3c.dom.Node
nodeValue
- new node value, as a String
.public short getNodeType()
getNodeType
in interface org.w3c.dom.Node
short
value node type.public org.w3c.dom.Node getParentNode()
null
value
indicates that the node is the root of its own tree. To add a
node to an existing tree, use one of the
insertBefore
, replaceChild
, or
appendChild
methods.
getParentNode
in interface org.w3c.dom.Node
Node
.insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
,
replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
,
appendChild(org.w3c.dom.Node)
public org.w3c.dom.NodeList getChildNodes()
null
if
the node has no children.
getChildNodes
in interface org.w3c.dom.Node
Node
, or
null
.public org.w3c.dom.Node getFirstChild()
null
if
the node has no children.
getFirstChild
in interface org.w3c.dom.Node
Node
, or
null
public org.w3c.dom.Node getLastChild()
null
if
the node has no children.
getLastChild
in interface org.w3c.dom.Node
Node
, or
null
.public org.w3c.dom.Node getPreviousSibling()
null
if this node has no previous sibling.
getPreviousSibling
in interface org.w3c.dom.Node
Node
, or
null
.public org.w3c.dom.Node getNextSibling()
null
if
the node has no next sibling.
getNextSibling
in interface org.w3c.dom.Node
Node
, or
null
.public org.w3c.dom.Document getOwnerDocument()
null
, since NodeImpl
s
do not belong to any Document
.
getOwnerDocument
in interface org.w3c.dom.Node
Document
.public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
newChild
before the existing
child node refChild
. If refChild
is
null
, insert newChild
at the end of
the list of children.
insertBefore
in interface org.w3c.dom.Node
newChild
- the Node
to insert.refChild
- the reference Node
.
java.lang.IllegalArgumentException
- if newChild
is
null
.public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
oldChild
with
newChild
in the list of children, and returns the
oldChild
node.
replaceChild
in interface org.w3c.dom.Node
newChild
- the Node
to insert.oldChild
- the Node
to be replaced.
java.lang.IllegalArgumentException
- if newChild
is
null
.public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
oldChild
from
the list of children, and returns it.
removeChild
in interface org.w3c.dom.Node
oldChild
- the Node
to be removed.
java.lang.IllegalArgumentException
- if oldChild
is
null
.public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
newChild
to the end of the list of
children of this node.
appendChild
in interface org.w3c.dom.Node
newChild
- the Node
to insert.
java.lang.IllegalArgumentException
- if newChild
is
null
.public boolean hasChildNodes()
true
if this node has child nodes.
hasChildNodes
in interface org.w3c.dom.Node
true
if this node has children.public org.w3c.dom.Node cloneNode(boolean deep)
getParentNode
returns null
).
If a shallow clone is being performed (deep
is
false
), the new node will not have any children or
siblings. If a deep clone is being performed, the new node
will form the root of a complete cloned subtree.
cloneNode
in interface org.w3c.dom.Node
deep
- if true
, recursively clone the subtree
under the specified node; if false
, clone only the
node itself.
public void normalize()
NodeImpl
s do not
contain Text
children.
normalize
in interface org.w3c.dom.Node
public boolean isSupported(java.lang.String feature, java.lang.String version)
false
since DOM features are not
supported.
isSupported
in interface org.w3c.dom.Node
feature
- a String
, which is ignored.version
- a String
, which is ignored.
false
.public java.lang.String getPrefix()
null
, since namespaces are not supported.
getPrefix
in interface org.w3c.dom.Node
null
.setPrefix(java.lang.String)
public void setPrefix(java.lang.String prefix)
setPrefix
in interface org.w3c.dom.Node
prefix
- a String
, which is ignored.getPrefix()
public java.lang.String getLocalName()
getNodeName
.
getLocalName
in interface org.w3c.dom.Node
String
.public org.w3c.dom.NamedNodeMap getAttributes()
getAttributes
in interface org.w3c.dom.Node
public boolean hasAttributes()
true
, if this node has attributes, otherwise
false
.
hasAttributes
in interface org.w3c.dom.Node
true
if node has attributes, otherwise false
..public int getLength()
getLength
in interface org.w3c.dom.NodeList
public org.w3c.dom.Node item(int index)
item
in interface org.w3c.dom.NodeList
public java.lang.String toString()
String
representation of this node.
toString
in class java.lang.Object
String
representation of this node.public java.lang.String toString(java.lang.String tab)
String
representation of this node.
tab
- tab for node indentation.
String
representation of this node.protected void beginToString(java.lang.StringBuffer sb, Indent indent)
beginToString and
endToString
. This was added to support
writing of the xml file. The Element
type of node: it writes the beginning tag, then calls
the child's toString
, and then writes the ending tag.
- Parameters:
sb
- string buffer to add resulting string.indent
- used in formating the output.
protected void endToString(java.lang.StringBuffer sb, Indent indent)
beginToString and
endToString
. This was added to support
writing of the xml file. The Element
type of node: it writes the beginning tag, then calls
the child's toString
, and then writes the ending tag.
- Parameters:
sb
- string buffer to add resulting string.indent
- used in formating the output.
public java.lang.String getBaseURI()
getBaseURI
in interface org.w3c.dom.Node
public short compareDocumentPosition(org.w3c.dom.Node arg0) throws org.w3c.dom.DOMException
compareDocumentPosition
in interface org.w3c.dom.Node
org.w3c.dom.DOMException
public java.lang.String getTextContent() throws org.w3c.dom.DOMException
getTextContent
in interface org.w3c.dom.Node
org.w3c.dom.DOMException
public void setTextContent(java.lang.String arg0) throws org.w3c.dom.DOMException
setTextContent
in interface org.w3c.dom.Node
org.w3c.dom.DOMException
public boolean isSameNode(org.w3c.dom.Node arg0)
isSameNode
in interface org.w3c.dom.Node
public java.lang.String lookupPrefix(java.lang.String arg0)
lookupPrefix
in interface org.w3c.dom.Node
public boolean isDefaultNamespace(java.lang.String arg0)
isDefaultNamespace
in interface org.w3c.dom.Node
public java.lang.String lookupNamespaceURI(java.lang.String arg0)
lookupNamespaceURI
in interface org.w3c.dom.Node
public boolean isEqualNode(org.w3c.dom.Node arg0)
isEqualNode
in interface org.w3c.dom.Node
public java.lang.Object getFeature(java.lang.String arg0, java.lang.String arg1)
getFeature
in interface org.w3c.dom.Node
public java.lang.Object setUserData(java.lang.String arg0, java.lang.Object arg1, org.w3c.dom.UserDataHandler arg2)
setUserData
in interface org.w3c.dom.Node
public java.lang.Object getUserData(java.lang.String arg0)
getUserData
in interface org.w3c.dom.Node
public java.lang.String getNamespaceURI()
getNamespaceURI
in interface org.w3c.dom.Node
|
EAF 7.6 Util | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |