com.gargoylesoftware.htmlunit.javascript.host
Class Attr

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.Node
              extended by com.gargoylesoftware.htmlunit.javascript.host.Attr
All Implemented Interfaces:
Serializable, Cloneable, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public class Attr
extends Node

A JavaScript object for an Attribute.

Version:
$Revision: 8947 $
Author:
Daniel Gredler, Chris Erskine, Ahmed Ashour, Sudhan Moghe, Ronald Brill, Frank Danek
See Also:
W3C DOM Level 2, MSDN documentation, Serialized Form

Field Summary
 
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.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 net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
Attr()
          Creates an instance.
 
Method Summary
 void detachFromParent()
          Detaches this attribute from the parent HTML element after caching the attribute value.
 Object getBaseName()
          Returns the base name of this element.
 String getBaseURI()
          Returns the Base URI as a string.
 DomAttr getDomNodeOrDie()
          Returns the DOM node that corresponds to this JavaScript object or throw an exception if one cannot be found.
 boolean getExpando()
          Returns true if the attribute is an custom property.
 Node getFirstChild()
          Gets the JavaScript property "firstChild" for the node that contains the current node.
 boolean getIsId()
          Returns true if this attribute is an ID.
 Node getLastChild()
          Gets the JavaScript property "lastChild" for the node that contains the current node.
 String getName()
          Returns the name of the attribute.
 String getNodeValue()
          Returns the value of this attribute.
 Object getOwnerElement()
          Returns the owner element.
 Node getParentNode()
          Gets the JavaScript property "parentNode" for the node that contains the current node.
 boolean getSpecified()
          Returns true if this attribute has been specified.
 String getValue()
          Returns the value of this attribute.
 void setValue(String value)
          Sets the value of this attribute.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node
addEventListener, appendChild, asJavaScriptException, attachEvent, cloneNode, compareDocumentPosition, contains, detachEvent, executeEvent, fireEvent, fireEvent, getAttributes, getChildNodes, getEventHandler, getEventHandlerProp, getJavaScriptNode, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getOwnerDocument, getParent, getParentElement, getPrefix, getPreviousSibling, getTextContent, getXml, hasChildNodes, hasEventHandlers, insertBefore, insertBeforeImpl, isSameNode, normalize, removeChild, removeEventListener, replaceChild, setEventHandler, setEventHandlerProp, setNodeValue, setTextContent
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement, setParentScope
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setPrototype, size
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attr

public Attr()
Creates an instance. JavaScript objects must have a default constructor.

Method Detail

detachFromParent

public void detachFromParent()
Detaches this attribute from the parent HTML element after caching the attribute value.


getIsId

public boolean getIsId()
Returns true if this attribute is an ID.

Returns:
true if this attribute is an ID

getExpando

public boolean getExpando()
Returns true if the attribute is an custom property.

Returns:
true if the attribute is an custom property

getName

public String getName()
Returns the name of the attribute.

Returns:
the name of the attribute

getNodeValue

public String getNodeValue()
Returns the value of this attribute.

Overrides:
getNodeValue in class Node
Returns:
the value of this attribute

getOwnerElement

public Object getOwnerElement()
Returns the owner element.

Returns:
the owner element

getParentNode

public Node getParentNode()
Gets the JavaScript property "parentNode" for the node that contains the current node.

Overrides:
getParentNode in class Node
Returns:
null

getSpecified

public boolean getSpecified()
Returns true if this attribute has been specified.

Returns:
true if this attribute has been specified

getValue

public String getValue()
Returns the value of this attribute.

Returns:
the value of this attribute

setValue

public void setValue(String value)
Sets the value of this attribute.

Parameters:
value - the new value of this attribute

getFirstChild

public Node getFirstChild()
Gets the JavaScript property "firstChild" for the node that contains the current node.

Overrides:
getFirstChild in class Node
Returns:
the first child node or null if the current node has no children.

getLastChild

public Node getLastChild()
Gets the JavaScript property "lastChild" for the node that contains the current node.

Overrides:
getLastChild in class Node
Returns:
the last child node or null if the current node has no children.

getDomNodeOrDie

public DomAttr getDomNodeOrDie()
                        throws IllegalStateException
Returns the DOM node that corresponds to this JavaScript object or throw an exception if one cannot be found.

Overrides:
getDomNodeOrDie in class SimpleScriptable
Returns:
the DOM node
Throws:
IllegalStateException - If the DOM node could not be found.

getBaseName

public Object getBaseName()
Returns the base name of this element.

Overrides:
getBaseName in class Node
Returns:
the base name of this element

getBaseURI

public String getBaseURI()
Returns the Base URI as a string.

Returns:
the Base URI as a string


Copyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.