Class HTMLElement

java.lang.Object
io.sf.carte.doc.dom.DOMElement
io.sf.carte.doc.dom.HTMLElement
All Implemented Interfaces:
DOMNode, NonDocumentTypeChildNode, ParentNode, CSSElement, CSSNode, Serializable, Element, HTMLElement, Node

public abstract class HTMLElement extends DOMElement implements HTMLElement
HTML-specific element nodes.
See Also:
  • Method Details

    • getDir

      public String getDir()
      Specified by:
      getDir in interface HTMLElement
    • setDir

      public void setDir(String dir)
      Specified by:
      setDir in interface HTMLElement
    • getLang

      public String getLang()
      Specified by:
      getLang in interface HTMLElement
    • setLang

      public void setLang(String lang)
      Specified by:
      setLang in interface HTMLElement
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface HTMLElement
    • setTitle

      public void setTitle(String title)
      Specified by:
      setTitle in interface HTMLElement
    • getOwnerDocument

      public abstract HTMLDocument getOwnerDocument()
      Get the DOMDocument object related to this node (for all nodes except DocumentType, it is the document that created it), which is also the object that should be used to create new nodes for the document.
      Specified by:
      getOwnerDocument in interface CSSNode
      Specified by:
      getOwnerDocument in interface DOMNode
      Specified by:
      getOwnerDocument in interface Node
      Returns:
      the DOMDocument object corresponding to this node. When this node is a DOMDocument or a DocumentType which was not added to any DOMDocument yet, this is null.
    • getNamespaceURI

      public String getNamespaceURI()
      Specified by:
      getNamespaceURI in interface Node
    • getPrefix

      public String getPrefix()
      Specified by:
      getPrefix in interface Node
    • setPrefix

      public void setPrefix(String prefix) throws DOMException
      Specified by:
      setPrefix in interface Node
      Throws:
      DOMException
    • hasChildNodes

      public boolean hasChildNodes()
      Description copied from interface: DOMNode
      Does this node have any child nodes ?
      Specified by:
      hasChildNodes in interface DOMNode
      Specified by:
      hasChildNodes in interface Node
      Returns:
      true if this node has child nodes, false otherwise.
    • getPreviousElementSibling

      public DOMElement getPreviousElementSibling()
      Description copied from interface: NonDocumentTypeChildNode
      Gets the first preceding sibling that is an element.
      Specified by:
      getPreviousElementSibling in interface NonDocumentTypeChildNode
      Returns:
      the first preceding sibling that is an element, and null otherwise.
    • getNextElementSibling

      public DOMElement getNextElementSibling()
      Description copied from interface: NonDocumentTypeChildNode
      Gets the first following sibling that is an element.
      Specified by:
      getNextElementSibling in interface NonDocumentTypeChildNode
      Returns:
      the first following sibling that is an element, and null otherwise.
    • prependChild

      public DOMNode prependChild(Node newChild) throws DOMException
      Throws:
      DOMException
    • getNodeValue

      public String getNodeValue() throws DOMException
      Specified by:
      getNodeValue in interface Node
      Throws:
      DOMException
    • setNodeValue

      public void setNodeValue(String nodeValue) throws DOMException
      Specified by:
      setNodeValue in interface Node
      Throws:
      DOMException
    • getNodeType

      public short getNodeType()
      Specified by:
      getNodeType in interface Node
    • getParentNode

      public DOMNode getParentNode()
      Specified by:
      getParentNode in interface DOMNode
      Specified by:
      getParentNode in interface Node
    • getChildNodes

      public DOMNodeList getChildNodes()
      Description copied from interface: DOMNode
      Get the children of this node.
      Specified by:
      getChildNodes in interface DOMNode
      Specified by:
      getChildNodes in interface Node
      Returns:
      a DOMNodeList with the children of this node. If there are no children, an empty list is returned.
    • getFirstChild

      public DOMNode getFirstChild()
      Description copied from interface: DOMNode
      Get the first child of this node.
      Specified by:
      getFirstChild in interface DOMNode
      Specified by:
      getFirstChild in interface Node
      Returns:
      the first child of this node, null if has no child nodes.
    • getLastChild

      public DOMNode getLastChild()
      Description copied from interface: DOMNode
      Get the last child of this node.
      Specified by:
      getLastChild in interface DOMNode
      Specified by:
      getLastChild in interface Node
      Returns:
      the last child of this node, null if has no child nodes.
    • getPreviousSibling

      public DOMNode getPreviousSibling()
      Description copied from interface: DOMNode
      Get the node immediately preceding this node in its parent's child list.
      Specified by:
      getPreviousSibling in interface DOMNode
      Specified by:
      getPreviousSibling in interface Node
      Returns:
      the node immediately preceding this node in the child list, or null if none.
    • getNextSibling

      public DOMNode getNextSibling()
      Description copied from interface: DOMNode
      Get the node immediately following this node in its parent's child list.
      Specified by:
      getNextSibling in interface DOMNode
      Specified by:
      getNextSibling in interface Node
      Returns:
      the node immediately following this node in the child list, or null if none.
    • appendChild

      public DOMNode appendChild(Node newChild) throws DOMException
      Description copied from interface: DOMNode
      Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed.
      Specified by:
      appendChild in interface DOMNode
      Specified by:
      appendChild in interface Node
      Parameters:
      newChild - the node to append. If it is a DocumentFragment object, the entire contents of the document fragment are moved into the child list of this node.
      Returns:
      the appended node.
      Throws:
      DOMException - HIERARCHY_REQUEST_ERR: raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself, or if this node is of type Document and the DOM application attempts to append a second DocumentType or Element node.
      WRONG_DOCUMENT_ERR: if newChild was created from a different document than the one that created this node.
      NOT_SUPPORTED_ERR: if this implementation does not support children of the type of newChild at this node.
    • insertBefore

      public DOMNode insertBefore(Node newChild, Node refChild) throws DOMException
      Inserts the node newChild right before node refChild in the child node list.
      • If refChild is null, newChild is appended at the end of the child list.
      • If the newChild is already in the tree, it is first removed.
      • Inserting a node before itself has no effect.
      Specified by:
      insertBefore in interface DOMNode
      Specified by:
      insertBefore in interface Node
      Parameters:
      newChild - the node to put at the child node list, before refChild. If it is a DocumentFragment object, the entire contents of the document fragment are inserted into the child list of this node.
      refChild - the node before which newChild must be inserted.
      Returns:
      the inserted node.
      Throws:
      DOMException - HIERARCHY_REQUEST_ERR: raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself, or if this node is of type Document and the DOM application attempts to append a second DocumentType or Element node.
      WRONG_DOCUMENT_ERR: if newChild was created from a different document than the one that created this node.
      NOT_FOUND_ERR: if refChild is not a child of this node.
      NOT_SUPPORTED_ERR: if this implementation does not support children of the type of newChild at this node.
    • replaceChild

      public DOMNode replaceChild(Node newChild, Node oldChild) throws DOMException
      Replaces the node oldChild with newChild. If the newChild is already in the tree, it is first removed.

      Replacing a node with itself has no effect.

      Specified by:
      replaceChild in interface DOMNode
      Specified by:
      replaceChild in interface Node
      Parameters:
      newChild - the node to put at the child node list, in place of oldChild. If it is a DocumentFragment object, the entire contents of the document fragment are inserted into the child list of this node.
      oldChild - the node being replaced.
      Returns:
      the replaced (old) node.
      Throws:
      DOMException - HIERARCHY_REQUEST_ERR: raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself, or if this node is of type Document and the DOM application attempts to append a second DocumentType or Element node.
      WRONG_DOCUMENT_ERR: if newChild was created from a different document than the one that created this node.
      NOT_FOUND_ERR: if oldChild is not a child of this node.
      NOT_SUPPORTED_ERR: if this implementation does not support children of the type of newChild at this node.
    • removeChild

      public DOMNode removeChild(Node oldChild) throws DOMException
      Description copied from interface: DOMNode
      Removes the node oldChild from the children of this node.
      Specified by:
      removeChild in interface DOMNode
      Specified by:
      removeChild in interface Node
      Parameters:
      oldChild - the node to remove.
      Returns:
      the removed node.
      Throws:
      DOMException - NOT_FOUND_ERR: if oldChild is not a child of this node.
    • removeAllChild

      public void removeAllChild()
      Description copied from interface: DOMNode
      Removes all the children from this node, if any.
      Specified by:
      removeAllChild in interface DOMNode
    • setUserData

      public Object setUserData(String key, Object data, UserDataHandler handler)
      Specified by:
      setUserData in interface Node
    • getUserData

      public Object getUserData(String key)
      Specified by:
      getUserData in interface Node
    • normalize

      public void normalize()
      Specified by:
      normalize in interface Node
    • getFeature

      @Deprecated public Object getFeature(String feature, String version)
      Deprecated.
      This method is deprecated and not supported.
      Specified by:
      getFeature in interface Node
      Parameters:
      feature - ignored.
      version - ignored.
      Returns:
      null.
    • isSupported

      @Deprecated public boolean isSupported(String feature, String version)
      Deprecated.
      This method is not supported.
      Specified by:
      isSupported in interface Node
      Parameters:
      feature - ignored.
      version - ignored.
      Returns:
      Always true.
    • compareDocumentPosition

      public short compareDocumentPosition(Node other) throws DOMException
      Specified by:
      compareDocumentPosition in interface Node
      Throws:
      DOMException
    • setTextContent

      public void setTextContent(String textContent) throws DOMException
      Specified by:
      setTextContent in interface Node
      Throws:
      DOMException
    • isDefaultNamespace

      public boolean isDefaultNamespace(String namespaceURI)
      Specified by:
      isDefaultNamespace in interface Node
    • isEqualNode

      public boolean isEqualNode(Node arg)
      Specified by:
      isEqualNode in interface Node
    • isSameNode

      public boolean isSameNode(Node other)
      Specified by:
      isSameNode in interface Node
    • contains

      public boolean contains(Node node)
      Test if node is an inclusive descendant of this node.
      Parameters:
      node - the node to test.
      Returns:
      true if node is an inclusive descendant of this node, false otherwise (including node being null).