| java.lang.Object org.enhydra.xml.NodeImpl org.enhydra.xml.ElementImpl
All known Subclasses: org.enhydra.xml.HashMapElement,
Field Summary | |
protected HashMap | attributes A HashMap of AttrImpl nodes representing
attributes. |
Constructor Summary | |
public | ElementImpl() Constructs an empty ElementImpl . | public | ElementImpl(ElementImpl element) Constructs a ElementImpl from the given node,
without creating entire children subtree. | public | ElementImpl(Document ownerDoc, String name) Constructs an ElementImpl with the given
document owner and node name. | protected | ElementImpl(Document ownerDoc, String nodeName, short type, String value) Constructs an ElementImpl with the given
document owner, node name, node type and node value. | public | ElementImpl(Node node) | public | ElementImpl(Node node, boolean deep) Constructs an ElementImpl from a given node, as a Node ,
and deep as boolean . |
Method Summary | |
public Node | appendChild(Node newChild) | protected void | beginToString(StringBuffer sb, Indent indent) Method beginToString for this class writes the xml
begining tag string and all attributes. | protected void | checkNode(Node node) | public Node | cloneNode(boolean deep) Returns a duplicate of this node. | public short | compareDocumentPosition(Node other) | protected void | endToString(StringBuffer sb, Indent indent) Method endToString for this class writes the xml
ending tag string. | public String | getAttribute(String name) Returns the value of the attribute with given name.
Parameters: name - name of attribute. | public String | getAttributeNS(String namespaceURI, String localName) Equivalent to getAttribute(localName) . | public Attr | getAttributeNode(String name) Returns attribute value with given name of this node.
Parameters: name - name of attribute. | public Attr | getAttributeNodeNS(String namespaceURI, String localName) Equivalent to getAttributeNode(localName) . | public NamedNodeMap | getAttributes() Returns all attribute nodes of this node. | public String | getBaseURI() | public NodeList | getChildNodes() | public NodeList | getElementsByTagName(String name) Returns all Element nodes with given name,
searching by all sub nodes from this node.
Parameters: name - tag name. | public NodeList | getElementsByTagNameNS(String namespaceURI, String localName) Equivalent to getElementsByTagName(localName) . | public Object | getFeature(String feature, String version) | public Node | getFirstChild() | public Node | getLastChild() | public int | getLength() | public String | getLocalName() | public String | getNamespaceURI() | public Node | getNextSibling() | public String | getNodeName() | public short | getNodeType() | public String | getNodeValue() | public Document | getOwnerDocument() | public Node | getParentNode() | public String | getPrefix() | public Node | getPreviousSibling() | public TypeInfo | getSchemaTypeInfo() | public String | getTagName() Returns tag name of this node. | public String | getTextContent() | public Object | getUserData(String key) | public boolean | hasAttribute(String name) Returns true , if this node has attribute with given name,
otherwise false . | public boolean | hasAttributeNS(String namespaceURI, String localName) Equivalent to hasAttribute(localName) . | public boolean | hasAttributes() Returns true , if this node has attributes, otherwise
false . | public boolean | hasChildNodes() | public boolean | hasElementChildNodes() Returns true if this node has children nodes. | protected void | initNodeImplChildren(Node node) | public Node | insertBefore(Node newChild, Node refChild) Inserts the node newChild before the existing
child node refChild . | public boolean | isDefaultNamespace(String namespaceURI) | public boolean | isEqualNode(Node arg) | public boolean | isSameNode(Node other) | public boolean | isSupported(String feature, String version) | public Node | item(int index) | public String | lookupNamespaceURI(String prefix) | public String | lookupPrefix(String namespaceURI) | protected Node | newCommentInstance(Node node) | protected Node | newDefaultInstance(Node node) | protected Node | newElementInstance(Node node) | public static Element | newInstance(Document document) Creates new instance of ElementImpl from a given document
as a Document .
Parameters: document - document. | protected Node | newTextInstance(Node node) | public void | normalize() | public void | removeAttribute(String name) Removes attribute with the given name. | public void | removeAttributeNS(String namespaceURI, String localName) Equivalent to removeAttribute(localName) . | public Attr | removeAttributeNode(Attr oldAttr) Remove attribute from this node.
Parameters: oldAttr - attribute that will be removed. | public Node | removeChild(Node oldChild) Removes the child node indicated by oldChild from
the list of children, and returns it.
Parameters: oldChild - the Node to be removed. | public Node | replaceChild(Node newChild, Node oldChild) Replaces the child node oldChild with
newChild in the list of children, and returns the
oldChild node.
Parameters: newChild - the Node to insert. Parameters: oldChild - the Node to be replaced. | public void | setAttribute(String name, String value) To the name attribute set value to value . | public void | setAttributeNS(String namespaceURI, String qualifiedName, String value) Equivalent to setAttribute(qualifiedName, value) . | public Attr | setAttributeNode(Attr newAttr) Add new attribute to this node.
Parameters: newAttr - new attribute. | public Attr | setAttributeNodeNS(Attr newAttr) Equivalent to setAttributeNode(newAttr) . | public void | setIdAttribute(String name, boolean isId) | public void | setIdAttributeNS(String namespaceURI, String localName, boolean isId) | public void | setIdAttributeNode(Attr idAttr, boolean isId) | public void | setNodeValue(String nodeValue) | public void | setPrefix(String prefix) | public void | setTextContent(String textContent) | public Object | setUserData(String key, Object data, UserDataHandler handler) | public String | toString() | public String | toString(String tab) |
attributes | protected HashMap attributes(Code) | | A HashMap of AttrImpl nodes representing
attributes.
|
ElementImpl | public ElementImpl()(Code) | | Constructs an empty ElementImpl .
|
ElementImpl | public ElementImpl(ElementImpl element)(Code) | | Constructs a ElementImpl from the given node,
without creating entire children subtree.
Parameters: element - , as a ElementImpl . |
ElementImpl | public ElementImpl(Document ownerDoc, String name)(Code) | | Constructs an ElementImpl with the given
document owner and node name.
Parameters: ownerDoc - the document owner of the node, as a Document . Parameters: name - is the name of the node, as a String . |
ElementImpl | protected ElementImpl(Document ownerDoc, String nodeName, short type, String value)(Code) | | Constructs an ElementImpl with the given
document owner, node name, node type and node value.
Parameters: ownerDoc - the document owner of the node, as a Document . Parameters: nodeName - the name of the node, as a String . Parameters: type - the type of the node, as a short . Parameters: value - the value of the node, as a String . |
ElementImpl | public ElementImpl(Node node)(Code) | | Constructs an ElementImpl from a given node (creates the children subtree too),
as a Node
Parameters: node - , as a Node . |
ElementImpl | public ElementImpl(Node node, boolean deep)(Code) | | Constructs an ElementImpl from a given node, as a Node ,
and deep as boolean .
Parameters: node - , as a Node . Parameters: deep - if true , recursively clone the subtreeunder the specified node; if false , clone only thenode itself. |
beginToString | protected void beginToString(StringBuffer sb, Indent indent)(Code) | | Method beginToString for this class writes the xml
begining tag string and all attributes.
Parameters: sb - string buffer to add resulting string. Parameters: indent - used in formating the output. |
cloneNode | public Node cloneNode(boolean deep)(Code) | | Returns a duplicate of this node. The duplicate node has no
parent (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.
Parameters: deep - if true , recursively clone the subtreeunder the specified node; if false , clone only thenode itself. the duplicate node. |
endToString | protected void endToString(StringBuffer sb, Indent indent)(Code) | | Method endToString for this class writes the xml
ending tag string.
Parameters: sb - string buffer to add resulting string. Parameters: indent - used in formating the output. |
getAttribute | public String getAttribute(String name)(Code) | | Returns the value of the attribute with given name.
Parameters: name - name of attribute. value of attribute. |
getAttributeNode | public Attr getAttributeNode(String name)(Code) | | Returns attribute value with given name of this node.
Parameters: name - name of attribute. value of attribute. |
getAttributeNodeNS | public Attr getAttributeNodeNS(String namespaceURI, String localName)(Code) | | Equivalent to getAttributeNode(localName) .
See Also: ElementImpl.setAttributeNodeNS Parameters: namespaceURI - is name space of the node Parameters: localName - is name of the node node |
getAttributes | public NamedNodeMap getAttributes()(Code) | | Returns all attribute nodes of this node.
all attribute nodes of this node as a NamedNodeMap . |
getElementsByTagName | public NodeList getElementsByTagName(String name)(Code) | | Returns all Element nodes with given name,
searching by all sub nodes from this node.
Parameters: name - tag name. all Element vith given name as NodeList . |
getElementsByTagNameNS | public NodeList getElementsByTagNameNS(String namespaceURI, String localName)(Code) | | Equivalent to getElementsByTagName(localName) .
Parameters: namespaceURI - is name space of the node Parameters: localName - is name of the node node |
getLength | public int getLength()(Code) | | |
getNodeType | public short getNodeType()(Code) | | |
getPreviousSibling | public Node getPreviousSibling()(Code) | | |
getTagName | public String getTagName()(Code) | | Returns tag name of this node.
tag name of this node as a String . |
hasAttribute | public boolean hasAttribute(String name)(Code) | | Returns true , if this node has attribute with given name,
otherwise false .
true if node has given attribute, otherwise false .. Parameters: name - is name of the node |
hasAttributeNS | public boolean hasAttributeNS(String namespaceURI, String localName)(Code) | | Equivalent to hasAttribute(localName) .
Parameters: namespaceURI - is name space of the node Parameters: localName - is name of the node node |
hasAttributes | public boolean hasAttributes()(Code) | | Returns true , if this node has attributes, otherwise
false .
true if node has attributes, otherwise false .. |
hasChildNodes | public boolean hasChildNodes()(Code) | | |
hasElementChildNodes | public boolean hasElementChildNodes()(Code) | | Returns true if this node has children nodes.
true if this node has children. |
initNodeImplChildren | protected void initNodeImplChildren(Node node)(Code) | | |
insertBefore | public Node insertBefore(Node newChild, Node refChild)(Code) | | Inserts the node newChild before the existing
child node refChild . If refChild is
null , insert newChild at the end of
the list of children.
Parameters: newChild - the Node to insert. Parameters: refChild - the reference Node . the node being inserted. exception: IllegalArgumentException - if newChild isnull . |
isDefaultNamespace | public boolean isDefaultNamespace(String namespaceURI)(Code) | | |
isEqualNode | public boolean isEqualNode(Node arg)(Code) | | |
isSameNode | public boolean isSameNode(Node other)(Code) | | |
newInstance | public static Element newInstance(Document document)(Code) | | Creates new instance of ElementImpl from a given document
as a Document .
Parameters: document - document. new Element node as a root of the Document . |
normalize | public void normalize()(Code) | | |
removeAttribute | public void removeAttribute(String name)(Code) | | Removes attribute with the given name.
Parameters: name - attribute name. |
removeAttributeNS | public void removeAttributeNS(String namespaceURI, String localName)(Code) | | Equivalent to removeAttribute(localName) .
Parameters: namespaceURI - is name space of the node Parameters: localName - is name of the node |
removeAttributeNode | public Attr removeAttributeNode(Attr oldAttr)(Code) | | Remove attribute from this node.
Parameters: oldAttr - attribute that will be removed. old attribute as AttrImpl . |
removeChild | public Node removeChild(Node oldChild)(Code) | | Removes the child node indicated by oldChild from
the list of children, and returns it.
Parameters: oldChild - the Node to be removed. the node removed. exception: IllegalArgumentException - if oldChild isnull . |
replaceChild | public Node replaceChild(Node newChild, Node oldChild)(Code) | | Replaces the child node oldChild with
newChild in the list of children, and returns the
oldChild node.
Parameters: newChild - the Node to insert. Parameters: oldChild - the Node to be replaced. the node replaced. exception: IllegalArgumentException - if newChild isnull . |
setAttribute | public void setAttribute(String name, String value)(Code) | | To the name attribute set value to value .
Parameters: name - attribute value. Parameters: value - new attribute value. |
setAttributeNS | public void setAttributeNS(String namespaceURI, String qualifiedName, String value)(Code) | | Equivalent to setAttribute(qualifiedName, value) .
See Also: ElementImpl.getAttributeNS Parameters: namespaceURI - is name space of the node Parameters: qualifiedName - is string Parameters: value - is value of the node |
setAttributeNode | public Attr setAttributeNode(Attr newAttr) throws DOMException(Code) | | Add new attribute to this node.
Parameters: newAttr - new attribute. new attribute as AttrImpl throws: DOMException - |
setNodeValue | public void setNodeValue(String nodeValue)(Code) | | |
|
|