Package org.eclipse.lemminx.dom

## 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 Summary

Fields
`static String` `XMLNS_ATTR`
`static String` `XMLNS_NO_DEFAULT_ATTR`

### Fields inherited from class org.eclipse.lemminx.dom.DOMNode

`DTD_ATT_LIST_NODE, DTD_DECL_NODE, DTD_ELEMENT_DECL_NODE, DTD_ENTITY_DECL_NODE, DTD_NOTATION_DECL, NULL_VALUE`

### Fields inherited from interface org.w3c.dom.Node

`ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE`

### Constructor Summary

Constructors
`DOMAttr​(String name, int start, int end, DOMNode ownerElement)`
`DOMAttr​(String name, DOMNode ownerElement)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `equals​(Object obj)`
`String` `extractPrefixFromXmlns()`
`int` `getDelimiterOffset()`
`int` `getEnd()` Returns the end offset of the node.
`String` `getLocalName()`
`String` `getName()`
`String` `getNamespaceURI()`
`DOMNode` `getNextSibling()`
`DOMRange` `getNodeAttrName()`
`DOMRange` `getNodeAttrValue()`
`String` `getNodeName()`
`short` `getNodeType()`
`String` `getNodeValue()`
`String` `getOriginalValue()` Get original attribute value from the document.
`DOMDocument` `getOwnerDocument()` Returns the owner document and null otherwise.
`DOMElement` `getOwnerElement()`
`String` `getPrefix()`
`String` `getPrefixIfMatchesURI​(String uri)` Returns the prefix if the given URI matches this attributes value.
`TypeInfo` `getSchemaTypeInfo()`
`boolean` `getSpecified()`
`int` `getStart()` Returns the start offset of the node.
`String` `getValue()`
`boolean` `hasDelimiter()`
`int` `hashCode()`
`boolean` `isDefaultXmlns()` Returns true if attribute name is the default xmlns attribute and false otherwise.
`static boolean` `isDefaultXmlns​(String attributeName)`
`boolean` `isId()`
`boolean` `isIncluded​(int offset)`
`boolean` `isNoDefaultXmlns()` Returns true if attribute name is the no default xmlns attribute and false otherwise.
`static boolean` `isNoDefaultXmlns​(String attributeName)`
`boolean` `isXmlns()` Returns true if attribute name is a xmlns attribute and false otherwise.
`static boolean` `isXmlns​(String attributeName)`
`void` `setDelimiter​(int delimiter)`
`void` `setValue​(String value)`
`void` `setValue​(String value, int start, int end)`
`boolean` `valueContainsOffset​(int offset)`

### Methods inherited from class org.eclipse.lemminx.dom.DOMNode

`addChild, appendChild, cloneNode, compareDocumentPosition, findAttrAt, findAttrAt, findDTDDeclParameterAt, findDTDDeclParameterAt, findNodeAt, findNodeBefore, findNodeOrAttrAt, findTextAt, getAttribute, getAttributeAtIndex, getAttributeNode, getAttributeNode, getAttributeNodes, getAttributes, getBaseURI, getChild, getChildNodes, getChildren, getChildrenWithAttributeValue, getFeature, getFirstChild, getLastChild, getOrphanEndElement, getOrphanEndElement, getParentElement, getParentNode, getPreviousNonTextSibling, getPreviousSibling, getTextContent, getUserData, hasAttribute, hasAttributes, hasChildNodes, insertBefore, isAttribute, isCDATA, isCharacterData, isChildOfOwnerDocument, isClosed, isComment, isDefaultNamespace, isDoctype, isDTDAttListDecl, isDTDElementDecl, isDTDEntityDecl, isDTDNotationDecl, isElement, isEqualNode, isGenericDTDDecl, isIncluded, isIncluded, isOwnerDocument, isProcessingInstruction, isProlog, isSameNode, isSupported, isText, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setAttribute, setAttributeNode, setNodeValue, setPrefix, setTextContent, setUserData, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.w3c.dom.Node

`appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getParentNode, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData`

### Field Detail

#### XMLNS_ATTR

    public static final String XMLNS_ATTR

See Also:
  Constant Field Values

#### XMLNS_NO_DEFAULT_ATTR

    public static final String XMLNS_NO_DEFAULT_ATTR

See Also:
  Constant Field Values

### Constructor Detail

#### DOMAttr

    public DOMAttr​(String name,
                   DOMNode ownerElement)

#### DOMAttr

    public DOMAttr​(String name,
                   int start,
                   int end,
                   DOMNode ownerElement)

### Method Detail

#### 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()