Package org.eclipse.lemminx.dom
Class DOMAttr
- java.lang.Object
-
- org.eclipse.lemminx.dom.DOMNode
-
- org.eclipse.lemminx.dom.DOMAttr
-
-
Field Summary
Fields Modifier and Type Field Description static StringXMLNS_ATTRstatic StringXMLNS_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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringextractPrefixFromXmlns()intgetDelimiterOffset()intgetEnd()Returns the end offset of the node.StringgetLocalName()StringgetName()StringgetNamespaceURI()DOMNodegetNextSibling()DOMRangegetNodeAttrName()DOMRangegetNodeAttrValue()StringgetNodeName()shortgetNodeType()StringgetNodeValue()StringgetOriginalValue()Get original attribute value from the document.DOMDocumentgetOwnerDocument()Returns the owner document and null otherwise.DOMElementgetOwnerElement()StringgetPrefix()StringgetPrefixIfMatchesURI(String uri)Returns the prefix if the given URI matches this attributes value.TypeInfogetSchemaTypeInfo()booleangetSpecified()intgetStart()Returns the start offset of the node.StringgetValue()booleanhasDelimiter()inthashCode()booleanisDefaultXmlns()Returns true if attribute name is the default xmlns attribute and false otherwise.static booleanisDefaultXmlns(String attributeName)booleanisId()booleanisIncluded(int offset)booleanisNoDefaultXmlns()Returns true if attribute name is the no default xmlns attribute and false otherwise.static booleanisNoDefaultXmlns(String attributeName)booleanisXmlns()Returns true if attribute name is a xmlns attribute and false otherwise.static booleanisXmlns(String attributeName)voidsetDelimiter(int delimiter)voidsetValue(String value)voidsetValue(String value, int start, int end)booleanvalueContainsOffset(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
-
-
Method Detail
-
getNodeType
public short getNodeType()
- Specified by:
getNodeTypein interfaceNode
-
getNodeName
public String getNodeName()
- Specified by:
getNodeNamein interfaceNode
-
getNodeValue
public String getNodeValue() throws DOMException
- Specified by:
getNodeValuein interfaceNode- Overrides:
getNodeValuein classDOMNode- Throws:
DOMException
-
getLocalName
public String getLocalName()
- Specified by:
getLocalNamein interfaceNode- Overrides:
getLocalNamein classDOMNode
-
getOwnerElement
public DOMElement getOwnerElement()
- Specified by:
getOwnerElementin interfaceAttr
-
getOwnerDocument
public DOMDocument getOwnerDocument()
Description copied from class:DOMNodeReturns the owner document and null otherwise.- Specified by:
getOwnerDocumentin interfaceDOMRange- Specified by:
getOwnerDocumentin interfaceNode- Overrides:
getOwnerDocumentin classDOMNode- Returns:
- the owner document and null otherwise.
-
getSchemaTypeInfo
public TypeInfo getSchemaTypeInfo()
- Specified by:
getSchemaTypeInfoin interfaceAttr
-
getSpecified
public boolean getSpecified()
- Specified by:
getSpecifiedin interfaceAttr
-
setValue
public void setValue(String value) throws DOMException
- Specified by:
setValuein interfaceAttr- 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()
-
getNamespaceURI
public String getNamespaceURI()
- Specified by:
getNamespaceURIin interfaceNode- Overrides:
getNamespaceURIin classDOMNode
-
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:
getNextSiblingin interfaceNode- Overrides:
getNextSiblingin classDOMNode
-
isIncluded
public boolean isIncluded(int offset)
-
getStart
public int getStart()
Description copied from interface:DOMRangeReturns the start offset of the node.
-
getEnd
public int getEnd()
Description copied from interface:DOMRangeReturns the end offset of the node.
-
getDelimiterOffset
public int getDelimiterOffset()
-
-