Class Attr

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

    public class Attr
    extends Node
    A JavaScript object for Attr.
    See Also:
    W3C DOM Level 2, MSDN documentation, Serialized Form
    • Constructor Detail

      • Attr

        public Attr()
        Creates an instance.
    • Method Detail

      • jsConstructor

        public void jsConstructor()
        JavaScript constructor.
        Overrides:
        jsConstructor in class Node
      • detachFromParent

        public void detachFromParent()
        Detaches this attribute from the parent HTML element after caching the attribute value.
      • getName

        public java.lang.String getName()
        Returns the name of the attribute.
        Returns:
        the name of the attribute
      • getNodeValue

        public java.lang.String getNodeValue()
        Returns the value of this attribute.
        Overrides:
        getNodeValue in class Node
        Returns:
        the value of this attribute
      • getOwnerElement

        public HtmlUnitScriptable getOwnerElement()
        Returns the owner element.
        Returns:
        the owner element
      • getParentNode

        public Node getParentNode()
        Gets the JavaScript property parentNode for the node that contains the current node.
        Overrides:
        getParentNode in class Node
        Returns:
        null
      • isSpecified

        public boolean isSpecified()
        Returns true if this attribute has been specified.
        Returns:
        true if this attribute has been specified
      • getValue

        public java.lang.String getValue()
        Returns the value of this attribute.
        Returns:
        the value of this attribute
      • setValue

        public void setValue​(java.lang.String value)
        Sets the value of this attribute.
        Parameters:
        value - the new value of this attribute
      • getFirstChild

        public Node getFirstChild()
        Gets the JavaScript property firstChild for the node that contains the current node.
        Overrides:
        getFirstChild in class Node
        Returns:
        the first child node or null if the current node has no children.
      • getLastChild

        public Node getLastChild()
        Gets the JavaScript property lastChild for the node that contains the current node.
        Overrides:
        getLastChild in class Node
        Returns:
        the last child node or null if the current node has no children.
      • getDomNodeOrDie

        public DomAttr getDomNodeOrDie()
        Returns the DOM node that corresponds to this JavaScript object or throw an exception if one cannot be found.
        Overrides:
        getDomNodeOrDie in class HtmlUnitScriptable
        Returns:
        the DOM node
      • getPrefix

        public java.lang.Object getPrefix()
        Returns the namespace prefix.
        Overrides:
        getPrefix in class Node
        Returns:
        the namespace prefix
      • getLocalName

        public java.lang.Object getLocalName()
        Returns the local name of this attribute.
        Overrides:
        getLocalName in class Node
        Returns:
        the local name of this attribute
      • getNamespaceURI

        public java.lang.Object getNamespaceURI()
        Returns the URI that identifies an XML namespace.
        Overrides:
        getNamespaceURI in class Node
        Returns:
        the URI that identifies an XML namespace
      • getRootNode

        public java.lang.Object getRootNode()
        Returns the owner document.
        Overrides:
        getRootNode in class Node
        Returns:
        the document