dbXML API

## org.dbxml.xml.dom
Class ElementImpl

    java.lang.Object
      |
      +--org.dbxml.xml.dom.NodeImpl
            |
            +--org.dbxml.xml.dom.ContainerNodeImpl
                  |
                  +--org.dbxml.xml.dom.ElementImpl

All Implemented Interfaces:
  CompressedNode, DBNode, org.w3c.dom.Element, org.w3c.dom.Node

public final class ElementImpl
extends ContainerNodeImpl
implements org.w3c.dom.Element

ElementImpl

Fields inherited from class org.dbxml.xml.dom.NodeImpl
`EX_DOMSTRING_SIZE, EX_HIERARCHY_REQUEST, EX_INDEX_SIZE, EX_INUSE_ATTRIBUTE, EX_INVALID_STATE, EX_NO_DATA_ALLOWED, EX_NO_MODIFICATION_ALLOWED, EX_NOT_FOUND, EX_WRONG_DOCUMENT, OBJECT_HREF, OBJECT_NS, OBJECT_TYPE, TYPE_APPEND, TYPE_CONTENT, TYPE_INSERT, TYPE_REPLACE, XMLNS_PREFIX`

Fields inherited from interface org.w3c.dom.Node
`ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE`

Constructor Summary
`ElementImpl()`
`ElementImpl(NodeImpl parentNode, boolean dirty)`
`ElementImpl(NodeImpl parentNode, byte[] data, int pos, int len)`
`ElementImpl(NodeImpl parentNode, java.lang.String nodeName)`

Method Summary
`void` `expandSource()` expandSource expands the source into the Node as a namespace and a set of attributes.
`java.lang.String` `getAttribute(java.lang.String name)` Retrieves an attribute value by name.
`org.w3c.dom.Attr` `getAttributeNode(java.lang.String name)` Retrieves an `Attr` node by name.
`org.w3c.dom.Attr` `getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)` Retrieves an `Attr` node by local name and namespace URI.
`java.lang.String` `getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)` Retrieves an attribute value by local name and namespace URI.
`org.w3c.dom.NamedNodeMap` `getAttributes()` A `NamedNodeMap` containing the attributes of this node (if it is an `Element`) or `null` otherwise.
`short` `getNodeType()` A code representing the type of the underlying object, as defined above.
`short` `getSymbolID()` getSymbolID returns the Symbol ID for the current node.
`java.lang.String` `getTagName()` The name of the element.
`boolean` `hasAttribute(java.lang.String name)`
`boolean` `hasAttributeNS(java.lang.String namespaceURI, java.lang.String localName)`
`boolean` `hasAttributes()`
`boolean` `hasAutoLink()`
`void` `removeAttribute(java.lang.String name)` Removes an attribute by name.
`org.w3c.dom.Attr` `removeAttributeNode(org.w3c.dom.Attr oldAttr)` Removes the specified attribute.
`void` `removeAttributeNS(java.lang.String namespaceURI, java.lang.String localName)` Removes an attribute by local name and namespace URI.
`void` `setAttribute(java.lang.String name, java.lang.String value)` Adds a new attribute.
`org.w3c.dom.Attr` `setAttributeNode(org.w3c.dom.Attr newAttr)` Adds a new attribute.
`org.w3c.dom.Attr` `setAttributeNodeNS(org.w3c.dom.Attr newAttr)` Adds a new attribute.
`void` `setAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value)` Adds a new attribute.

Methods inherited from class org.dbxml.xml.dom.ContainerNodeImpl
`appendChild, getChildNodes, getElementById, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getLastChild, hasChildNodes, insertBefore, normalize, removeChild, replaceChild`

Methods inherited from class org.dbxml.xml.dom.NodeImpl

`checkReadOnly, cloneNode, getDataBytes, getDataLen, getDataPos, getKey, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSource, getUserData, isDefined, isDirty, isLoaded, isSameNode, isSupported, load, lookupDefaultNamespaceURI, lookupNamespacePrefix, lookupNamespaceURI, normalizeNS, setDataBytes, setDataBytes, setDataLen, setDataPos, setDirty, setNodeName, setNodeValue, setParentNode, setPrefix, setSource, setUserData, unload`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.w3c.dom.Element
`getElementsByTagName, getElementsByTagNameNS`

Methods inherited from interface org.w3c.dom.Node
`appendChild, cloneNode, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix`

Constructor Detail

### ElementImpl

    public ElementImpl()

### ElementImpl

    public ElementImpl(NodeImpl parentNode,
                       byte[] data,
                       int pos,
                       int len)

### ElementImpl

    public ElementImpl(NodeImpl parentNode,
                       boolean dirty)

### ElementImpl

    public ElementImpl(NodeImpl parentNode,
                       java.lang.String nodeName)

Method Detail

### hasAutoLink

    public boolean hasAutoLink()

### getSymbolID

    public short getSymbolID()

  Description copied from interface: `CompressedNode`
  getSymbolID returns the Symbol ID for the current node. Some nodes will not have a Symbol ID, in which case, a value of -1 is returned.
  Overrides:
    `getSymbolID` in class `NodeImpl`
  Following copied from interface: `org.dbxml.xml.dom.CompressedNode`
  Returns:
    The Symbol ID

### expandSource

    public void expandSource()

  Description copied from interface: `DBNode`
  expandSource expands the source into the Node as a namespace and a set of attributes. This method will only work on a Document or an Element, and should silently fail on all other Node types.
  Overrides:
    `expandSource` in class `NodeImpl`

### getNodeType

    public short getNodeType()

  Description copied from class: `NodeImpl`
  A code representing the type of the underlying object, as defined above.
  Specified by:
    `getNodeType` in interface `org.w3c.dom.Node`
  Overrides:
    `getNodeType` in class `NodeImpl`

### getAttributes

    public org.w3c.dom.NamedNodeMap getAttributes()

  A `NamedNodeMap` containing the attributes of this node (if it is an `Element`) or `null` otherwise.
  Specified by:
    `getAttributes` in interface `org.w3c.dom.Node`
  Overrides:
    `getAttributes` in class `NodeImpl`

### hasAttributes

    public boolean hasAttributes()

  Specified by:
    `hasAttributes` in interface `org.w3c.dom.Node`
  Overrides:
    `hasAttributes` in class `NodeImpl`

### hasAttribute

    public boolean hasAttribute(java.lang.String name)

  Specified by:
    `hasAttribute` in interface `org.w3c.dom.Element`

### removeAttribute

    public void removeAttribute(java.lang.String name)
                         throws org.w3c.dom.DOMException

  Removes an attribute by name. If the removed attribute has a default value it is immediately replaced.
  Specified by:
    `removeAttribute` in interface `org.w3c.dom.Element`
  Parameters:
    `name` - The name of the attribute to remove.
  Throws:
    `org.w3c.dom.DOMException` - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

### getTagName

    public java.lang.String getTagName()

  The name of the element. For example, in: <elementExample id="demo"> ... </elementExample> , `tagName` has the value `"elementExample"`. Note that this is case-preserving in XML, as are all of the operations of the DOM. The HTML DOM returns the `tagName` of an HTML element in the canonical uppercase form, regardless of the case in the source HTML document.
  Specified by:
    `getTagName` in interface `org.w3c.dom.Element`

### getAttribute

    public java.lang.String getAttribute(java.lang.String name)

  Retrieves an attribute value by name.
  Specified by:
    `getAttribute` in interface `org.w3c.dom.Element`
  Parameters:
    `name` - The name of the attribute to retrieve.
  Returns:
    The `Attr` value as a string, or the empty string if that attribute does not have a specified or default value.

### setAttributeNode

    public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr)
                                      throws org.w3c.dom.DOMException

  Adds a new attribute. If an attribute with that name is already present in the element, it is replaced by the new one.
  Specified by:
    `setAttributeNode` in interface `org.w3c.dom.Element`
  Parameters:
    `newAttr` - The `Attr` node to add to the attribute list.
  Returns:
    If the `newAttr` attribute replaces an existing attribute with the same name, the previously existing `Attr` node is returned, otherwise `null` is returned.
  Throws:
    `org.w3c.dom.DOMException` - WRONG_DOCUMENT_ERR: Raised if `newAttr` was created from a different document than the one that created the element.
    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
    INUSE_ATTRIBUTE_ERR: Raised if `newAttr` is already an attribute of another `Element` object. The DOM user must explicitly clone `Attr` nodes to re-use them in other elements.

### setAttribute

    public void setAttribute(java.lang.String name,
                             java.lang.String value)
                      throws org.w3c.dom.DOMException

  Adds a new attribute. If an attribute with that name is already present in the element, its value is changed to be that of the value parameter. This value is a simple string, it is not parsed as it is being set. So any markup (such as syntax to be recognized as an entity reference) is treated as literal text, and needs to be appropriately escaped by the implementation when it is written out. In order to assign an attribute value that contains entity references, the user must create an `Attr` node plus any `Text` and `EntityReference` nodes, build the appropriate subtree, and use `setAttributeNode` to assign it as the value of an attribute.
  Specified by:
    `setAttribute` in interface `org.w3c.dom.Element`
  Parameters:
    `name` - The name of the attribute to create or alter.
    `value` - Value to set in string form.
  Throws:
    `org.w3c.dom.DOMException` - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.
    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

### getAttributeNode

    public org.w3c.dom.Attr getAttributeNode(java.lang.String name)

  Retrieves an `Attr` node by name.
  Specified by:
    `getAttributeNode` in interface `org.w3c.dom.Element`
  Parameters:
    `name` - The name of the attribute to retrieve.
  Returns:
    The `Attr` node with the specified attribute name or `null` if there is no such attribute.

### removeAttributeNode

    public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr)
                                         throws org.w3c.dom.DOMException

  Removes the specified attribute.
  Specified by:
    `removeAttributeNode` in interface `org.w3c.dom.Element`
  Parameters:
    `oldAttr` - The `Attr` node to remove from the attribute list. If the removed `Attr` has a default value it is immediately replaced.
  Returns:
    The `Attr` node that was removed.
  Throws:
    `org.w3c.dom.DOMException` - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
    NOT_FOUND_ERR: Raised if `oldAttr` is not an attribute of the element.

### getAttributeNS

    public java.lang.String getAttributeNS(java.lang.String namespaceURI,
                                           java.lang.String localName)

  Retrieves an attribute value by local name and namespace URI. HTML-only DOM implementations do not need to implement this method.
  Specified by:
    `getAttributeNS` in interface `org.w3c.dom.Element`
  Parameters:
    `namespaceURI` - The namespace URI of the attribute to retrieve.
    `localName` - The local name of the attribute to retrieve.
  Returns:
    The `Attr` value as a string, or an `null` if that attribute does not have a specified or default value. This is different from `getAttribute` which never return `null` .
  Since:
    DOM Level 2

### setAttributeNS

    public void setAttributeNS(java.lang.String namespaceURI,
                               java.lang.String qualifiedName,
                               java.lang.String value)

  Adds a new attribute. If an attribute with the same local name and namespace URI is already present on the element, its prefix is changed to be the prefix part of the `qualifiedName` , and its value is changed to be the `value` parameter. This value is a simple string; it is not parsed as it is being set. So any markup (such as syntax to be recognized as an entity reference) is treated as literal text, and needs to be appropriately escaped by the implementation when it is written out. In order to assign an attribute value that contains entity references, the user must create an `Attr` node plus any `Text` and `EntityReference` nodes, build the appropriate subtree, and use `setAttributeNodeNS` or `setAttributeNode` to assign it as the value of an attribute.
  HTML-only DOM implementations do not need to implement this method.
  Specified by:
    `setAttributeNS` in interface `org.w3c.dom.Element`
  Parameters:
    `namespaceURI` - The namespace URI of the attribute to create or alter.
    `qualifiedName` - The qualified name of the attribute to create or alter.
    `value` - The value to set in string form.
  Throws:
    `org.w3c.dom.DOMException` - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character.
    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
    NAMESPACE_ERR: Raised if the `qualifiedName` is malformed, if the `qualifiedName` has a prefix and the `namespaceURI` is `null` or an empty string, if the `qualifiedName` has a prefix that is "xml" and the `namespaceURI` is different from "http://www.w3.org/XML/1998/namespace", if the `qualifiedName` has a prefix that is "xmlns" and the `namespaceURI` is different from "http://www.w3.org/2000/xmlns/", or if the `qualifiedName` is "xmlns" and the `namespaceURI` is different from "http://www.w3.org/2000/xmlns/".
  Since:
    DOM Level 2

### removeAttributeNS

    public void removeAttributeNS(java.lang.String namespaceURI,
                                  java.lang.String localName)

  Removes an attribute by local name and namespace URI. If the removed attribute has a default value it is immediately replaced. The replacing attribute has the same namespace URI and local name, as well as the original prefix.
  HTML-only DOM implementations do not need to implement this method.
  Specified by:
    `removeAttributeNS` in interface `org.w3c.dom.Element`
  Parameters:
    `namespaceURI` - The namespace URI of the attribute to remove.
    `localName` - The local name of the attribute to remove.
  Throws:
    `org.w3c.dom.DOMException` - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  Since:
    DOM Level 2

### getAttributeNodeNS

    public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI,
                                               java.lang.String localName)

  Retrieves an `Attr` node by local name and namespace URI. HTML-only DOM implementations do not need to implement this method.
  Specified by:
    `getAttributeNodeNS` in interface `org.w3c.dom.Element`
  Parameters:
    `namespaceURI` - The namespace URI of the attribute to retrieve.
    `localName` - The local name of the attribute to retrieve.
  Returns:
    The `Attr` node with the specified attribute local name and namespace URI or `null` if there is no such attribute.
  Since:
    DOM Level 2

### setAttributeNodeNS

    public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr)

  Adds a new attribute. If an attribute with that local name and that namespace URI is already present in the element, it is replaced by the new one.
  HTML-only DOM implementations do not need to implement this method.
  Specified by:
    `setAttributeNodeNS` in interface `org.w3c.dom.Element`
  Parameters:
    `newAttr` - The `Attr` node to add to the attribute list.
  Returns:
    If the `newAttr` attribute replaces an existing attribute with the same local name and namespace URI , the replaced `Attr` node is returned, otherwise `null` is returned.
  Throws:
    `org.w3c.dom.DOMException` - WRONG_DOCUMENT_ERR: Raised if `newAttr` was created from a different document than the one that created the element.
    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
    INUSE_ATTRIBUTE_ERR: Raised if `newAttr` is already an attribute of another `Element` object. The DOM user must explicitly clone `Attr` nodes to re-use them in other elements.
  Since:
    DOM Level 2

### hasAttributeNS

    public boolean hasAttributeNS(java.lang.String namespaceURI,
                                  java.lang.String localName)

  Specified by:
    `hasAttributeNS` in interface `org.w3c.dom.Element`

dbXML API

Copyright (c) 1999-2001 The dbXML Group, All rights reserved