org.apache.xalan.stree
Class AttrImpl

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

public class AttrImpl
extends Child
implements Attr


Method Summary
 java.lang.String getLocalName()
          Returns the local part of the qualified name of this node.
 java.lang.String getName()
           
 java.lang.String getNamespaceURI()
          The namespace URI of this node, or null if it is unspecified.
 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.
 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, getChildPosition, getFirstChild, getLastChild, getLevel, getNextSibling, getOwnerDocument, getParentNode, getPreviousSibling, getTagName, getUid, hasChildNodes, isComplete, isNamespaceNode, setAttribute, setLevel, supports
 
Methods inherited from class org.apache.xalan.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.
Overrides:
getNodeType in class UnImplNode

getNodeName

public java.lang.String getNodeName()
Returns the 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.
Overrides:
getNamespaceURI in class Child

getPrefix

public java.lang.String getPrefix()
The namespace prefix of this node, or null if it is unspecified.
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.
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
Since:
DOM Level 2

getNodeValue

public java.lang.String getNodeValue()
                              throws DOMException
Same as getValue().
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
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
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
Overrides:
getOwnerElement in class UnImplNode
Since:
DOM Level 2

getName

public java.lang.String getName()
Specified by:
getName in interface Attr


Copyright © 2000 Apache XML Project. All Rights Reserved.