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
-
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 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_NODEFields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDetaches 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 propertyfirstChildfor the node that contains the current node.Gets the JavaScript propertylastChildfor 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 propertyparentNodefor the node that contains the current node.Returns the namespace prefix.Returns the owner document.getValue()Returns the value of this attribute.booleanReturnstrueif this attribute has been specified.voidJavaScript constructor.voidSets the value of this attribute.Methods inherited from class 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, setTextContentMethods inherited from class EventTarget
addEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeEventListener, setEventHandlerMethods inherited from class HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromiseMethods 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
-
detachFromParent
public void detachFromParent()Detaches this attribute from the parent HTML element after caching the attribute value. -
getName
-
getNodeValue
Returns the value of this attribute.- Overrides:
getNodeValuein classNode- Returns:
- the value of this attribute
-
getOwnerElement
-
getParentNode
Gets the JavaScript propertyparentNodefor the node that contains the current node.- Overrides:
getParentNodein classNode- Returns:
null
-
isSpecified
public boolean isSpecified()Returnstrueif this attribute has been specified.- Returns:
trueif this attribute has been specified
-
getValue
-
setValue
Sets the value of this attribute.- Parameters:
value- the new value of this attribute
-
getFirstChild
Gets the JavaScript propertyfirstChildfor the node that contains the current node.- Overrides:
getFirstChildin classNode- Returns:
- the first child node or null if the current node has no children.
-
getLastChild
Gets the JavaScript propertylastChildfor the node that contains the current node.- Overrides:
getLastChildin 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:
getDomNodeOrDiein classHtmlUnitScriptable- Returns:
- the DOM node
-
getPrefix
-
getLocalName
Returns the local name of this attribute.- Overrides:
getLocalNamein classNode- Returns:
- the local name of this attribute
-
getNamespaceURI
Returns the URI that identifies an XML namespace.- Overrides:
getNamespaceURIin classNode- Returns:
- the URI that identifies an XML namespace
-
getRootNode
Returns the owner document.- Overrides:
getRootNodein classNode- Returns:
- the document
-