Class DomAttr
- java.lang.Object
-
- com.gargoylesoftware.htmlunit.html.DomNode
-
- com.gargoylesoftware.htmlunit.html.DomNamespaceNode
-
- com.gargoylesoftware.htmlunit.html.DomAttr
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.w3c.dom.Attr,org.w3c.dom.Node
public class DomAttr extends DomNamespaceNode implements org.w3c.dom.Attr
An attribute of an element. Attributes are stored inHtmlElement, but the XPath engine expects attributes to be in aDomNode.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.DomNode
DomNode.ChildIterator, DomNode.DescendantElementsIterator<T extends DomNode>
-
-
Field Summary
-
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode
AS_TEXT_BLANK, AS_TEXT_BLOCK_SEPARATOR, AS_TEXT_NEW_LINE, AS_TEXT_TAB, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED
-
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 Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCanonicalXPath()Returns the canonical XPath expression which identifies this node, for instance "/html/body/table[3]/tbody/tr[5]/td[2]/span/a[3]".java.lang.StringgetName()java.lang.StringgetNodeName()Returns this node's node name.shortgetNodeType()Returns this node's node type.java.lang.StringgetNodeValue()DomElementgetOwnerElement()org.w3c.dom.TypeInfogetSchemaTypeInfo()Not yet implemented.booleangetSpecified()java.lang.StringgetTextContent()java.lang.StringgetValue()booleanisId()voidsetNodeValue(java.lang.String value)voidsetTextContent(java.lang.String textContent)voidsetValue(java.lang.String value)java.lang.StringtoString()-
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNamespaceNode
getLocalName, getLowercaseName, getNamespaceURI, getPrefix, getQualifiedName, processImportNode, setPrefix
-
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNode
addCharacterDataChangeListener, addDomChangeListener, appendChild, asNormalizedText, asText, asXml, basicRemove, checkChildHierarchy, cloneNode, compareDocumentPosition, detach, fireCharacterDataChanged, fireNodeAdded, fireNodeDeleted, getAncestors, getAttributes, getBaseURI, getByXPath, getByXPath, getChildNodes, getChildren, getDescendants, getDomElementDescendants, getEndColumnNumber, getEndLineNumber, getFeature, getFirstByXPath, getFirstByXPath, getFirstChild, getHtmlElementDescendants, getHtmlPageOrNull, getIndex, getLastChild, getNextElementSibling, getNextSibling, getOwnerDocument, getPage, getParentNode, getPreviousElementSibling, getPreviousSibling, getReadyState, getScriptableObject, getSelectorList, getStartColumnNumber, getStartLineNumber, getUserData, getVisibleText, handles, hasAttributes, hasChildNodes, hasFeature, insertBefore, insertBefore, isAncestorOf, isAncestorOfAny, isAttachedToPage, isDefaultNamespace, isDisplayed, isEqualNode, isSameNode, isSupported, isTrimmedText, lookupNamespaceURI, lookupPrefix, mayBeDisplayed, normalize, notifyIncorrectness, onAddedToDocumentFragment, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, printXml, querySelector, querySelectorAll, quietlyRemoveAndMoveChildrenTo, remove, removeAllChildren, removeCharacterDataChangeListener, removeChild, removeDomChangeListener, replace, replaceChild, setEndLocation, setNextSibling, setParentNode, setPreviousSibling, setReadyState, setScriptableObject, setStartLocation, setUserData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setPrefix, setUserData
-
-
-
-
Constructor Detail
-
DomAttr
public DomAttr(SgmlPage page, java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value, boolean specified)
Instantiate a new attribute.- Parameters:
page- the page that the attribute belongs tonamespaceURI- the namespace that defines the attribute name (may benull)qualifiedName- the name of the attributevalue- the value of the attributespecified-trueif this attribute was explicitly given a value in the source document, or if the application changed the value of the attribute
-
-
Method Detail
-
getNodeType
public short getNodeType()
Returns this node's node type.- Specified by:
getNodeTypein interfaceorg.w3c.dom.Node- Specified by:
getNodeTypein classDomNode- Returns:
- this node's node type
-
getNodeName
public java.lang.String getNodeName()
Returns this node's node name.- Specified by:
getNodeNamein interfaceorg.w3c.dom.Node- Specified by:
getNodeNamein classDomNode- Returns:
- this node's node name
-
getNodeValue
public java.lang.String getNodeValue()
- Specified by:
getNodeValuein interfaceorg.w3c.dom.Node- Overrides:
getNodeValuein classDomNode
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceorg.w3c.dom.Attr
-
getValue
public java.lang.String getValue()
- Specified by:
getValuein interfaceorg.w3c.dom.Attr
-
setNodeValue
public void setNodeValue(java.lang.String value)
- Specified by:
setNodeValuein interfaceorg.w3c.dom.Node
-
setValue
public void setValue(java.lang.String value)
- Specified by:
setValuein interfaceorg.w3c.dom.Attr
-
getOwnerElement
public DomElement getOwnerElement()
- Specified by:
getOwnerElementin interfaceorg.w3c.dom.Attr
-
getSpecified
public boolean getSpecified()
- Specified by:
getSpecifiedin interfaceorg.w3c.dom.Attr
-
getSchemaTypeInfo
public org.w3c.dom.TypeInfo getSchemaTypeInfo()
Not yet implemented.- Specified by:
getSchemaTypeInfoin interfaceorg.w3c.dom.Attr
-
isId
public boolean isId()
- Specified by:
isIdin interfaceorg.w3c.dom.Attr
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getCanonicalXPath
public java.lang.String getCanonicalXPath()
Returns the canonical XPath expression which identifies this node, for instance "/html/body/table[3]/tbody/tr[5]/td[2]/span/a[3]".
WARNING: This sort of automated XPath expression is often quite bad at identifying a node, as it is highly sensitive to changes in the DOM tree.
- Overrides:
getCanonicalXPathin classDomNode- Returns:
- the canonical XPath expression which identifies this node
- See Also:
DomNode.getByXPath(String)
-
getTextContent
public java.lang.String getTextContent()
- Specified by:
getTextContentin interfaceorg.w3c.dom.Node- Overrides:
getTextContentin classDomNode
-
setTextContent
public void setTextContent(java.lang.String textContent)
- Specified by:
setTextContentin interfaceorg.w3c.dom.Node- Overrides:
setTextContentin classDomNode
-
-