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:
Serializable
,Cloneable
,org.htmlunit.corejs.javascript.ConstProperties
,org.htmlunit.corejs.javascript.debug.DebuggableObject
,org.htmlunit.corejs.javascript.Scriptable
,org.htmlunit.corejs.javascript.SymbolScriptable
A JavaScript object for
Attr
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
-
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
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Detaches this attribute from the parent HTML element after caching the attribute value.Returns the DOM node that corresponds to this JavaScript object or throw an exception if one cannot be found.Gets the JavaScript propertyfirstChild
for the node that contains the current node.Gets the JavaScript propertylastChild
for the node that contains the current node.Returns the local name of this attribute.getName()
Returns the name of the attribute.Returns the URI that identifies an XML namespace.Returns the value of this attribute.Returns the owner element.Gets the JavaScript propertyparentNode
for the node that contains the current node.Returns the namespace prefix.Returns the owner document.getValue()
Returns the value of this attribute.boolean
Returnstrue
if this attribute has been specified.void
JavaScript constructor.void
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
-
Constructor Details
-
Attr
public Attr()Creates an instance.
-
-
Method Details
-
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
Returns the name of the attribute.- Returns:
- the name of the attribute
-
getNodeValue
Returns the value of this attribute.- Overrides:
getNodeValue
in classNode
- Returns:
- the value of this attribute
-
getOwnerElement
Returns the owner element.- Returns:
- the owner element
-
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
Returns the value of this attribute.- Returns:
- the value of this attribute
-
setValue
Sets the value of this attribute.- Parameters:
value
- the new value of this attribute
-
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
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
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
Returns the namespace prefix. -
getLocalName
Returns the local name of this attribute.- Overrides:
getLocalName
in classNode
- Returns:
- the local name of this attribute
-
getNamespaceURI
Returns the URI that identifies an XML namespace.- Overrides:
getNamespaceURI
in classNode
- Returns:
- the URI that identifies an XML namespace
-
getRootNode
Returns the owner document.- Overrides:
getRootNode
in classNode
- Returns:
- the document
-