Package org.htmlunit.javascript.host.dom
Class Attr
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.javascript.HtmlUnitScriptable
-
- org.htmlunit.javascript.host.event.EventTarget
-
- org.htmlunit.javascript.host.dom.Node
-
- org.htmlunit.javascript.host.dom.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 forAttr
.- See Also:
- W3C DOM Level 2, MSDN documentation, Serialized Form
-
-
Field Summary
-
Fields inherited from class org.htmlunit.javascript.host.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 Constructor Description Attr()
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
detachFromParent()
Detaches this attribute from the parent HTML element after caching the attribute value.DomAttr
getDomNodeOrDie()
Returns the DOM node that corresponds to this JavaScript object or throw an exception if one cannot be found.Node
getFirstChild()
Gets the JavaScript propertyfirstChild
for the node that contains the current node.Node
getLastChild()
Gets the JavaScript propertylastChild
for the node that contains the current node.java.lang.Object
getLocalName()
Returns the local name of this attribute.java.lang.String
getName()
Returns the name of the attribute.java.lang.Object
getNamespaceURI()
Returns the URI that identifies an XML namespace.java.lang.String
getNodeValue()
Returns the value of this attribute.HtmlUnitScriptable
getOwnerElement()
Returns the owner element.Node
getParentNode()
Gets the JavaScript propertyparentNode
for the node that contains the current node.java.lang.Object
getPrefix()
Returns the namespace prefix.java.lang.Object
getRootNode()
Returns the owner document.java.lang.String
getValue()
Returns the value of this attribute.boolean
isSpecified()
Returnstrue
if this attribute has been specified.void
jsConstructor()
JavaScript constructor.void
setValue(java.lang.String value)
Sets the value of this attribute.-
Methods inherited from class org.htmlunit.javascript.host.dom.Node
after, append, appendChild, before, cloneNode, compareDocumentPosition, contains, getAttributes, getBaseURI, getChildElementCount, getChildNodes, getChildren, getFirstElementChild, getJavaScriptNode, getLastElementChild, getNextSibling, getNodeName, getNodeType, getOwnerDocument, getParent, getParentElement, getPreviousSibling, getTextContent, hasAttributes, hasChildNodes, insertBefore, insertBeforeImpl, isEqualNode, isSameNode, normalize, prepend, remove, removeChild, replaceChild, replaceChildren, replaceWith, setNodeValue, setTextContent
-
Methods inherited from class org.htmlunit.javascript.host.event.EventTarget
addEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeEventListener, setEventHandler
-
Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
-
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
-
-
-
-
Method Detail
-
jsConstructor
public void jsConstructor()
JavaScript constructor.- Overrides:
jsConstructor
in classNode
-
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 classNode
- 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 propertyparentNode
for the node that contains the current node.- Overrides:
getParentNode
in classNode
- Returns:
null
-
isSpecified
public boolean isSpecified()
Returnstrue
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 propertyfirstChild
for the node that contains the current node.- Overrides:
getFirstChild
in classNode
- Returns:
- the first child node or null if the current node has no children.
-
getLastChild
public Node getLastChild()
Gets the JavaScript propertylastChild
for the node that contains the current node.- Overrides:
getLastChild
in classNode
- 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 classHtmlUnitScriptable
- Returns:
- the DOM node
-
getPrefix
public java.lang.Object getPrefix()
Returns the namespace prefix.
-
getLocalName
public java.lang.Object getLocalName()
Returns the local name of this attribute.- Overrides:
getLocalName
in classNode
- Returns:
- the local name of this attribute
-
getNamespaceURI
public java.lang.Object getNamespaceURI()
Returns the URI that identifies an XML namespace.- Overrides:
getNamespaceURI
in classNode
- Returns:
- the URI that identifies an XML namespace
-
getRootNode
public java.lang.Object getRootNode()
Returns the owner document.- Overrides:
getRootNode
in classNode
- Returns:
- the document
-
-