com.gargoylesoftware.htmlunit.xml
Class XmlAttr

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.html.DomNode
      extended by com.gargoylesoftware.htmlunit.html.DomNamespaceNode
          extended by com.gargoylesoftware.htmlunit.xml.XmlAttr
All Implemented Interfaces:
Serializable, Cloneable, Map.Entry

public class XmlAttr
extends DomNamespaceNode
implements Map.Entry

An attribute of an element. Attributes are stored in XmlElement, but the xpath engine expects attributes to be in a DomNode.

Version:
$Revision: 2132 $
Author:
Ahmed Ashour
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.DomNode
DomNode.ChildIterator, DomNode.DescendantElementsIterator
 
Field Summary
 
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode
ATTRIBUTE_NODE, COMMENT_NODE, DOCUMENT_NODE, ELEMENT_NODE, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED, TEXT_NODE
 
Constructor Summary
XmlAttr(Page page, String namespaceURI, String qualifiedName, String value)
          Instantiate a new attribute.
XmlAttr(XmlElement xmlElement, Map.Entry mapEntry)
          Deprecated. Use constructor with explicit names.
 
Method Summary
 Object getKey()
          
 String getName()
           
 String getNodeName()
          Get the name for the current node.
 short getNodeType()
          Get the type of the current node.
 String getNodeValue()
          Get the value for the current node.
 Object getValue()
           
protected  void setParentNode(DomNode parent)
          Set the parent node
 Object setValue(Object value)
          Set the value of the attribute.
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNamespaceNode
getLocalName, getNamespaceURI, getPrefix, getQualifiedName, setPrefix
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNode
addDomChangeListener, addPropertyChangeListener, appendChild, appendDomChild, asText, asXml, cloneDomNode, cloneNode, fireNodeAdded, fireNodeDeleted, firePropertyChange, getAllHtmlChildElements, getByXPath, getChildIterator, getChildrenAsText, getEndColumnNumber, getEndLineNumber, getEventHandler, getFirstByXPath, getFirstChild, getFirstDomChild, getLastChild, getLastDomChild, getLog, getNativePage, getNextDomSibling, getNextSibling, getPage, getParentDomNode, getParentNode, getPreviousDomSibling, getPreviousSibling, getReadyState, getScriptObject, getStartColumnNumber, getStartLineNumber, hasAttributes, insertBefore, isAncestorOf, isRenderedVisible, isTrimmedText, notifyIncorrectness, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, printXml, reduceWhitespace, remove, removeAllChildren, removeDomChangeListener, removeEventHandler, removePropertyChangeListener, replace, setEventHandler, setEventHandler, setNextSibling, setNodeValue, setPreviousSibling, setReadyState, setScriptObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map.Entry
equals, hashCode
 

Constructor Detail

XmlAttr

public XmlAttr(XmlElement xmlElement,
               Map.Entry mapEntry)
Deprecated. Use constructor with explicit names.

Instantiate a new attribute.

Parameters:
xmlElement - The parent element.
mapEntry - The wrapped Map.Entry.

XmlAttr

public XmlAttr(Page page,
               String namespaceURI,
               String qualifiedName,
               String value)
Instantiate a new attribute.

Parameters:
page - The page that the attribute belongs to.
namespaceURI - The namespace that defines the attribute name. May be null.
qualifiedName - The name of the attribute.
value - The value of the attribute.
Method Detail

getNodeType

public short getNodeType()
Get the type of the current node.

Specified by:
getNodeType in class DomNode
Returns:
The node type

getNodeName

public String getNodeName()
Get the name for the current node.

Specified by:
getNodeName in class DomNode
Returns:
The node name

getNodeValue

public String getNodeValue()
Get the value for the current node.

Overrides:
getNodeValue in class DomNode
Returns:
The node value

getKey

public Object getKey()

Specified by:
getKey in interface Map.Entry

getName

public String getName()
Returns:
The qualified name of the attribute.

getValue

public Object getValue()
Specified by:
getValue in interface Map.Entry
Returns:
The value of the attribute.

setValue

public Object setValue(Object value)
Set the value of the attribute.

Specified by:
setValue in interface Map.Entry
Parameters:
value - new value to be stored in this entry.
Returns:
old value corresponding to the entry.

setParentNode

protected void setParentNode(DomNode parent)
Set the parent node

Overrides:
setParentNode in class DomNode
Parameters:
parent - the parent node


Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.