Class DOMAttr

java.lang.Object
org.eclipse.lemminx.dom.DOMNode
org.eclipse.lemminx.dom.DOMAttr
All Implemented Interfaces:
DOMRange, Attr, Node

public class DOMAttr extends DOMNode implements Attr
An attribute node.
  • Field Details

  • Constructor Details

    • DOMAttr

      public DOMAttr(String name, DOMNode ownerElement)
    • DOMAttr

      public DOMAttr(String name, int start, int end, DOMNode ownerElement)
  • Method Details

    • getNodeType

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

      public String getNodeName()
      Specified by:
      getNodeName in interface Node
    • getName

      public String getName()
      Specified by:
      getName in interface Attr
    • getNodeValue

      public String getNodeValue() throws DOMException
      Specified by:
      getNodeValue in interface Node
      Overrides:
      getNodeValue in class DOMNode
      Throws:
      DOMException
    • getLocalName

      public String getLocalName()
      Specified by:
      getLocalName in interface Node
      Overrides:
      getLocalName in class DOMNode
    • getOwnerElement

      public DOMElement getOwnerElement()
      Specified by:
      getOwnerElement in interface Attr
    • getOwnerDocument

      public DOMDocument getOwnerDocument()
      Description copied from class: DOMNode
      Returns the owner document and null otherwise.
      Specified by:
      getOwnerDocument in interface DOMRange
      Specified by:
      getOwnerDocument in interface Node
      Overrides:
      getOwnerDocument in class DOMNode
      Returns:
      the owner document and null otherwise.
    • getValue

      public String getValue()
      Specified by:
      getValue in interface Attr
    • getSchemaTypeInfo

      public TypeInfo getSchemaTypeInfo()
      Specified by:
      getSchemaTypeInfo in interface Attr
    • getSpecified

      public boolean getSpecified()
      Specified by:
      getSpecified in interface Attr
    • isId

      public boolean isId()
      Specified by:
      isId in interface Attr
    • setValue

      public void setValue(String value) throws DOMException
      Specified by:
      setValue in interface Attr
      Throws:
      DOMException
    • getNodeAttrName

      public DOMRange getNodeAttrName()
    • setDelimiter

      public void setDelimiter(int delimiter)
    • hasDelimiter

      public boolean hasDelimiter()
    • getOriginalValue

      public String getOriginalValue()
      Get original attribute value from the document. This will include quotations (", ').
      Returns:
      attribute value with quotations if it had them.
    • setValue

      public void setValue(String value, int start, int end)
    • getNodeAttrValue

      public DOMRange getNodeAttrValue()
    • valueContainsOffset

      public boolean valueContainsOffset(int offset)
    • getPrefix

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

      public String getNamespaceURI()
      Specified by:
      getNamespaceURI in interface Node
      Overrides:
      getNamespaceURI in class DOMNode
    • isXmlns

      public boolean isXmlns()
      Returns true if attribute name is a xmlns attribute and false otherwise.
      Parameters:
      attributeName -
      Returns:
      true if attribute name is a xmlns attribute and false otherwise.
    • isXmlns

      public static boolean isXmlns(String attributeName)
    • isDefaultXmlns

      public boolean isDefaultXmlns()
      Returns true if attribute name is the default xmlns attribute and false otherwise.
      Parameters:
      attributeName -
      Returns:
      true if attribute name is the default xmlns attribute and false otherwise.
    • isDefaultXmlns

      public static boolean isDefaultXmlns(String attributeName)
    • extractPrefixFromXmlns

      public String extractPrefixFromXmlns()
    • getPrefixIfMatchesURI

      public String getPrefixIfMatchesURI(String uri)
      Returns the prefix if the given URI matches this attributes value. If the URI doesnt match, null is returned.
      Parameters:
      uri -
      Returns:
    • isNoDefaultXmlns

      public boolean isNoDefaultXmlns()
      Returns true if attribute name is the no default xmlns attribute and false otherwise.
      Parameters:
      attributeName -
      Returns:
      true if attribute name is the no default xmlns attribute and false otherwise.
    • isNoDefaultXmlns

      public static boolean isNoDefaultXmlns(String attributeName)
    • getNextSibling

      public DOMNode getNextSibling()
      Specified by:
      getNextSibling in interface Node
      Overrides:
      getNextSibling in class DOMNode
    • isIncluded

      public boolean isIncluded(int offset)
    • getStart

      public int getStart()
      Description copied from interface: DOMRange
      Returns the start offset of the node.
      Specified by:
      getStart in interface DOMRange
      Overrides:
      getStart in class DOMNode
      Returns:
      the start offset of the node.
    • getEnd

      public int getEnd()
      Description copied from interface: DOMRange
      Returns the end offset of the node.
      Specified by:
      getEnd in interface DOMRange
      Overrides:
      getEnd in class DOMNode
      Returns:
      the end offset of the node.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getDelimiterOffset

      public int getDelimiterOffset()