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 voiddetachFromParent()Detaches this attribute from the parent HTML element after caching the attribute value.DomAttrgetDomNodeOrDie()Returns the DOM node that corresponds to this JavaScript object or throw an exception if one cannot be found.NodegetFirstChild()Gets the JavaScript propertyfirstChildfor the node that contains the current node.NodegetLastChild()Gets the JavaScript propertylastChildfor the node that contains the current node.java.lang.ObjectgetLocalName()Returns the local name of this attribute.java.lang.StringgetName()Returns the name of the attribute.java.lang.ObjectgetNamespaceURI()Returns the URI that identifies an XML namespace.java.lang.StringgetNodeValue()Returns the value of this attribute.HtmlUnitScriptablegetOwnerElement()Returns the owner element.NodegetParentNode()Gets the JavaScript propertyparentNodefor the node that contains the current node.java.lang.ObjectgetPrefix()Returns the namespace prefix.java.lang.ObjectgetRootNode()Returns the owner document.java.lang.StringgetValue()Returns the value of this attribute.booleanisSpecified()Returnstrueif this attribute has been specified.voidjsConstructor()JavaScript constructor.voidsetValue(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:
jsConstructorin 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:
getNodeValuein 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 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
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 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
public Node 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
public DomAttr 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
public java.lang.Object getPrefix()
Returns the namespace prefix.
-
getLocalName
public java.lang.Object getLocalName()
Returns the local name of this attribute.- Overrides:
getLocalNamein classNode- Returns:
- the local name of this attribute
-
getNamespaceURI
public java.lang.Object getNamespaceURI()
Returns the URI that identifies an XML namespace.- Overrides:
getNamespaceURIin classNode- Returns:
- the URI that identifies an XML namespace
-
getRootNode
public java.lang.Object getRootNode()
Returns the owner document.- Overrides:
getRootNodein classNode- Returns:
- the document
-
-