org.apache.xalan.stree
Class AttrImpl

java.lang.Object
  |
  +--org.apache.xml.utils.UnImplNode
        |
        +--org.apache.xalan.stree.Child
              |
              +--org.apache.xalan.stree.AttrImpl
Direct Known Subclasses:
AttrImplNS

public class AttrImpl
extends Child
implements Attr

**For internal use only** Class to hold information about an attribute node.


Method Summary
 void dispatchCharactersEvent(ContentHandler ch)
          Handle a Characters event
 java.lang.String getLocalName()
          Returns the local part of the qualified name of this node.
 java.lang.String getName()
          Get this attribute's name
 java.lang.String getNamespaceURI()
          The namespace URI of this node, or null if it is unspecified.
 Node getNextSibling()
          The node immediately following this node.
 java.lang.String getNodeName()
          Returns the node name.
 short getNodeType()
          A short integer indicating what type of node this is.
 java.lang.String getNodeValue()
          Same as getValue().
 Element getOwnerElement()
          The Element node this attribute is attached to or null if this attribute is not in use.
 java.lang.String getPrefix()
          The namespace prefix of this node, or null if it is unspecified.
 Node getPreviousSibling()
          The node immediately preceding this node.
 boolean getSpecified()
          If this attribute was explicitly given a value in the original document, this is true ; otherwise, it is false .
 java.lang.String getValue()
          Returns the value of this attribute node.
 void setValue(java.lang.String value)
          Sets the value of this attribute node.
 
Methods inherited from class org.apache.xalan.stree.Child
getAttributes, getFirstChild, getLastChild, getLevel, getOwnerDocument, getParentNode, getTagName, getUid, hasChildNodes, isComplete, isNamespaceNode, isSupported, setAttribute, setComplete, setLevel
 
Methods inherited from class org.apache.xml.utils.UnImplNode
appendChild, appendData, cloneNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, error, error, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildNodes, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getLength, hasAttribute, hasAttributeNS, hasAttributes, importNode, insertBefore, insertData, item, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, replaceData, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setNodeValue, setPrefix, splitText, substringData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNodeType

public short getNodeType()
A short integer indicating what type of node this is. The named constants for this value are defined in the org.w3c.dom.Node interface.
Returns:
node type of attribute
Overrides:
getNodeType in class UnImplNode

getNodeName

public java.lang.String getNodeName()
Returns the node name.
Returns:
node name
Overrides:
getNodeName in class UnImplNode

getNamespaceURI

public java.lang.String getNamespaceURI()
The namespace URI of this node, or null if it is unspecified.
This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time.
For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null.Per the Namespaces in XML Specification an attribute does not inherit its namespace from the element it is attached to. If an attribute is not explicitly given a namespace, it simply has no namespace.
Returns:
namespace URI
Overrides:
getNamespaceURI in class Child

getPrefix

public java.lang.String getPrefix()
The namespace prefix of this node, or null if it is unspecified.
Returns:
namespace prefix of this node
Overrides:
getPrefix in class Child
Since:
DOM Level 2

getLocalName

public java.lang.String getLocalName()
Returns the local part of the qualified name of this node.
For nodes created with a DOM Level 1 method, such as createElement from the Document interface, it is null.
Returns:
local part of the qualified name of this node
Overrides:
getLocalName in class Child
Since:
DOM Level 2

getValue

public java.lang.String getValue()
Returns the value of this attribute node.
For nodes created with a DOM Level 1 method, such as createElement from the Document interface, it is null.
Specified by:
getValue in interface Attr
Returns:
the value of this attribute node
Since:
DOM Level 2

getNodeValue

public java.lang.String getNodeValue()
                              throws DOMException
Same as getValue().
Returns:
the value of this attribute node
Throws:
DOMException -  
Overrides:
getNodeValue in class UnImplNode

setValue

public void setValue(java.lang.String value)
              throws DOMException
Sets the value of this attribute node.
For nodes created with a DOM Level 1 method, such as createElement from the Document interface, it is null.
Specified by:
setValue in interface Attr
Parameters:
value - Attribute value to be set
Throws:
DOMException -  
Overrides:
setValue in class UnImplNode
Since:
DOM Level 2

getSpecified

public boolean getSpecified()
If this attribute was explicitly given a value in the original document, this is true ; otherwise, it is false . Note that the implementation is in charge of this attribute, not the user. If the user changes the value of the attribute (even if it ends up having the same value as the default value) then the specified flag is automatically flipped to true . To re-specify the attribute as the default value from the DTD, the user must delete the attribute. The implementation will then make a new attribute available with specified set to false and the default value (if one exists).
In summary: If the attribute has an assigned value in the document then specified is true , and the value is the assigned value. If the attribute has no assigned value in the document and has a default value in the DTD, then specified is false , and the value is the default value in the DTD. If the attribute has no assigned value in the document and has a value of #IMPLIED in the DTD, then the attribute does not appear in the structure model of the document.
Specified by:
getSpecified in interface Attr
Returns:
whether this attribute was explicitly given a value in the original document
Overrides:
getSpecified in class UnImplNode

getOwnerElement

public Element getOwnerElement()
The Element node this attribute is attached to or null if this attribute is not in use.
Specified by:
getOwnerElement in interface Attr
Returns:
node this attribute is attached to
Overrides:
getOwnerElement in class UnImplNode
Since:
DOM Level 2

getName

public java.lang.String getName()
Get this attribute's name
Specified by:
getName in interface Attr
Returns:
attribute name

getPreviousSibling

public Node getPreviousSibling()
The node immediately preceding this node. If there is no such node, this returns null.
Returns:
node immediately preceding this node
Overrides:
getPreviousSibling in class Child

getNextSibling

public Node getNextSibling()
The node immediately following this node. If there is no such node, this returns null.
Returns:
node immediately following this node
Overrides:
getNextSibling in class Child

dispatchCharactersEvent

public void dispatchCharactersEvent(ContentHandler ch)
                             throws SAXException
Handle a Characters event
Parameters:
ch - Content handler to handle SAX events
Throws:
SAXException - if the content handler characters event throws a SAXException.
Overrides:
dispatchCharactersEvent in class Child


Copyright � 2000 Apache XML Project. All Rights Reserved.