| java.lang.Object org.enhydra.xml.NodeImpl org.enhydra.xml.ElementImpl
All known Subclasses: org.enhydra.xml.HashMapElement,
Field Summary | |
final public static int | MASK_NAME Name character mask. | final public static int | MASK_NAME_START Name start character mask. | 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 | |
protected void | beginToString(StringBuffer sb, Indent indent) Method beginToString for this class writes the xml
begining tag string and all attributes. | public Node | cloneNode(boolean deep) Returns a duplicate of this node. | public short | compareDocumentPosition(Node arg0) | 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 | 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 arg0, String arg1) | public String | getNamespaceURI() | public TypeInfo | getSchemaTypeInfo() | public String | getTagName() Returns tag name of this node. | public String | getTextContent() | public Object | getUserData(String arg0) | 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 | hasElementChildNodes() Returns true if this node has children nodes. | public Node | insertBefore(Node newChild, Node refChild) Inserts the node newChild before the existing
child node refChild . | public boolean | isDefaultNamespace(String arg0) | public boolean | isEqualNode(Node arg0) | public boolean | isSameNode(Node arg0) | public static boolean | isValidName(String name) | public String | lookupNamespaceURI(String arg0) | public String | lookupPrefix(String arg0) | public static Element | newInstance(Document document) Creates new instance of ElementImpl from a given document
as a Document .
Parameters: document - document. | 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 arg0, boolean arg1) | public void | setIdAttributeNS(String arg0, String arg1, boolean arg2) | public void | setIdAttributeNode(Attr arg0, boolean arg1) | public void | setTextContent(String arg0) | public Object | setUserData(String arg0, Object arg1, UserDataHandler arg2) |
MASK_NAME | final public static int MASK_NAME(Code) | | Name character mask.
|
MASK_NAME_START | final public static int MASK_NAME_START(Code) | | Name start character mask.
|
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.
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: nodeName - 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
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 .
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. |
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) .
|
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 .. |
hasAttributeNS | public boolean hasAttributeNS(String namespaceURI, String localName)(Code) | | Equivalent to hasAttribute(localName) .
|
hasAttributes | public boolean hasAttributes()(Code) | | Returns true , if this node has attributes, otherwise
false .
true if node has attributes, otherwise false .. |
hasElementChildNodes | public boolean hasElementChildNodes()(Code) | | Returns true if this node has children nodes.
true if this node has children. |
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 arg0)(Code) | | |
isEqualNode | public boolean isEqualNode(Node arg0)(Code) | | |
isSameNode | public boolean isSameNode(Node arg0)(Code) | | |
isValidName | public static boolean isValidName(String name)(Code) | | Check to see if a string is a valid Name according to [5]
in the XML 1.0 Recommendation
Parameters: name - string to check true if name is a valid Name |
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 . |
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) .
|
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. |
setAttributeNode | public Attr setAttributeNode(Attr newAttr) throws DOMException(Code) | | Add new attribute to this node.
Parameters: newAttr - new attribute. new attribute as AttrImpl . |
|
|