|
EAF 7.4 Util | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.xml.NodeImpl
org.enhydra.xml.ElementImpl
org.enhydra.xml.HashMapElement
public class HashMapElement
Namespaces are ignored in this implementation. The terms "tag name" and "node name" are always considered to be synonymous.
Field Summary | |
---|---|
protected java.util.HashMap |
children
All Element |
Fields inherited from class org.enhydra.xml.ElementImpl |
---|
attributes, MASK_NAME, MASK_NAME_START |
Fields inherited from class org.enhydra.xml.NodeImpl |
---|
firstChild, lastChild, nextSibling, nodeName, nodeValue, numChildren, ownerDocument, parent, previousSibling, type |
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 | |
---|---|
|
HashMapElement()
Constructs an empty HashMapElement . |
|
HashMapElement(org.w3c.dom.Document ownerDoc,
java.lang.String name)
Constructs an HashMapElement with the given
document owner and node name. |
protected |
HashMapElement(org.w3c.dom.Document ownerDoc,
java.lang.String nodeName,
short type,
java.lang.String value)
Constructs an HashMapElement with the given
document owner, node name, node type and node value. |
|
HashMapElement(HashMapElement element)
Constructs a HashMapElement from the given node,
without creating entire children subtree. |
|
HashMapElement(org.w3c.dom.Node node)
Constructs an HashMapElement from a given node
(creates the children subtree too), as a Node |
|
HashMapElement(org.w3c.dom.Node node,
boolean deep)
Constructs an HashMapElement from a given node,
as a Node , and deep as boolean . |
Method Summary | |
---|---|
org.w3c.dom.Node |
cloneNode(boolean deep)
Returns a duplicate of this node. |
org.w3c.dom.NodeList |
getChildrenByTagName(java.lang.String name)
Returns the list of all children nodes with the given tag name. |
org.w3c.dom.NodeList |
getElementsByTagName(java.lang.String name)
Returns all Element nodes with given name,
searching by all sub nodes from this node. |
org.w3c.dom.Element |
getFirstChildByTagName(java.lang.String name)
Returns the first child Element with the given tag name. |
org.w3c.dom.Element |
getNextSameNameNode()
Returns the next Element node (if exists) with the same tag name. |
java.lang.String |
getText()
Returns the concatenation of values of all text type children. |
boolean |
hasElementChildNodes()
Returns true if this node has child nodes. |
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 . |
protected org.w3c.dom.Node |
newElementInstance(org.w3c.dom.Node node)
Creates new instance of the HashMapElement class from the given Node . |
static org.w3c.dom.Element |
newInstance(org.w3c.dom.Document document)
Creates new instance of HashMapElement from a given document
as a Document . |
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 |
setText(java.lang.String text)
Set the value of the first text child node to the given text, and remove all other text child nodes. |
Methods inherited from class org.enhydra.xml.NodeImpl |
---|
appendChild, getChildNodes, getFirstChild, getLastChild, getLength, getLocalName, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, initNodeImplChildren, isSupported, item, newCommentInstance, newDefaultInstance, newTextInstance, normalize, setNodeValue, setPrefix, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Node |
---|
appendChild, getChildNodes, getFirstChild, getLastChild, getLocalName, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, isSupported, normalize, setNodeValue, setPrefix |
Field Detail |
---|
protected java.util.HashMap children
Element type children of this Element
Constructor Detail |
---|
public HashMapElement()
HashMapElement
.
public HashMapElement(HashMapElement element)
HashMapElement
from the given node,
without creating entire children subtree.
element,
- as a HashMapElement
.public HashMapElement(org.w3c.dom.Document ownerDoc, java.lang.String name)
HashMapElement
with the given
document owner and node name.
ownerDoc
- the document owner of the node, as a Document
.nodeName
- the name of the node, as a String
.protected HashMapElement(org.w3c.dom.Document ownerDoc, java.lang.String nodeName, short type, java.lang.String value)
HashMapElement
with the 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
.public HashMapElement(org.w3c.dom.Node node)
HashMapElement
from a given node
(creates the children subtree too), as a Node
node,
- as a Node
.public HashMapElement(org.w3c.dom.Node node, boolean deep)
HashMapElement
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.Method Detail |
---|
protected org.w3c.dom.Node newElementInstance(org.w3c.dom.Node node)
Node
.
newElementInstance
in class NodeImpl
node,
- as a Node
.
public static org.w3c.dom.Element newInstance(org.w3c.dom.Document document)
HashMapElement
from a given document
as a Document
.
document
- document.
Element
node as a root of the 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
insertBefore
in class ElementImpl
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
replaceChild
in class ElementImpl
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
removeChild
in class ElementImpl
oldChild
- the Node
to be removed.
java.lang.IllegalArgumentException
- if oldChild
is
null
.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
cloneNode
in class ElementImpl
deep
- if true
, recursively clone the subtree
under the specified node; if false
, clone only the
node itself.
public org.w3c.dom.NodeList getElementsByTagName(java.lang.String name)
Element
nodes with given name,
searching by all sub nodes from this node.
getElementsByTagName
in interface org.w3c.dom.Element
getElementsByTagName
in class ElementImpl
name
- tag name.
Element
vith given name as NodeList
.public boolean hasElementChildNodes()
true
if this node has child nodes.
hasElementChildNodes
in class ElementImpl
true
if this node has children.public org.w3c.dom.NodeList getChildrenByTagName(java.lang.String name)
name
- tag name.
public org.w3c.dom.Element getFirstChildByTagName(java.lang.String name)
Element
with the given tag name.
name
- tag name.
Element
with the given tag name.public org.w3c.dom.Element getNextSameNameNode()
Element
node (if exists) with the same tag name.
Element
node (if exists) with the same tag name.public java.lang.String getText()
public void setText(java.lang.String text)
text
- new text.
|
EAF 7.4 Util | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |