Xindice API
version 1.1

org.apache.xindice.xml.dom
Class AttrImpl

java.lang.Object
  |
  +--org.apache.xindice.xml.dom.NodeImpl
        |
        +--org.apache.xindice.xml.dom.ContainerNodeImpl
              |
              +--org.apache.xindice.xml.dom.AttrImpl
All Implemented Interfaces:
org.w3c.dom.Attr, CompressedNode, DBNode, org.w3c.dom.Node

public final class AttrImpl
extends ContainerNodeImpl
implements org.w3c.dom.Attr

AttrImpl

Version:
$Revision: 518460 $, $Date: 2007-03-14 23:47:19 -0400 (Wed, 14 Mar 2007) $

Fields inherited from class org.apache.xindice.xml.dom.ContainerNodeImpl
childNodes
 
Fields inherited from class org.apache.xindice.xml.dom.NodeImpl
data, dirty, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, EX_DOMSTRING_SIZE, EX_HIERARCHY_REQUEST, EX_INDEX_SIZE, EX_INUSE_ATTRIBUTE, EX_INVALID_STATE, EX_NO_DATA_ALLOWED, EX_NO_MODIFICATION_ALLOWED, EX_NOT_FOUND, EX_WRONG_DOCUMENT, handlers, key, len, loaded, nodeName, nodeValue, nsURI, OBJECT_HREF, OBJECT_NS, OBJECT_TYPE, ownerDocument, parentNode, pos, source, TYPE_APPEND, TYPE_CONTENT, TYPE_INSERT, TYPE_REPLACE, userData, XMLNS_PREFIX, XMLNS_URI
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
AttrImpl()
           
AttrImpl(NodeImpl parentNode, boolean dirty)
           
AttrImpl(NodeImpl parentNode, byte[] data, int pos, int len)
           
AttrImpl(NodeImpl parentNode, String nodeName)
           
AttrImpl(NodeImpl parentNode, String nodeName, String nsURI, short symbolID, String nodeValue)
           
 
Method Summary
 String getName()
          Returns the name of this attribute.
 short getNodeType()
          A code representing the type of the underlying object, as defined above.
 String getNodeValue()
          The value of this node, depending on its type; see the table above.
 org.w3c.dom.Element getOwnerElement()
           
 org.w3c.dom.TypeInfo getSchemaTypeInfo()
           
 boolean getSpecified()
          If this attribute was explicitly given a value in the original document, this is true; otherwise, it is false.
 short getSymbolID()
          getSymbolID returns the Symbol ID for the current node.
 String getValue()
          On retrieval, the value of the attribute is returned as a string.
 boolean isId()
           
protected  boolean isNodeTypeValid(short type)
           
 void setNodeValue(String nodeValue)
          The value of this node, depending on its type; see the table above.
 void setSpecified(boolean specified)
           
 void setSymbolID(short symbolID)
           
 void setValue(String value)
           
 
Methods inherited from class org.apache.xindice.xml.dom.ContainerNodeImpl
appendChild, checkLoaded, getChildNodes, getElementById, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getLastChild, getNextSibling, getPreviousSibling, getTextContent, hasChildNodes, insertBefore, isEqualNode, loadChildren, normalize, removeChild, replaceChild
 
Methods inherited from class org.apache.xindice.xml.dom.NodeImpl
checkReadOnly, cloneNode, cloneNode, compareDocumentPosition, expandSource, getAttributes, getBaseURI, getDataBytes, getDataLen, getDataPos, getFeature, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSource, getUserData, hasAttributes, invokeHandlers, invokeHandlers, isDefaultNamespace, isDefined, isDirty, isLoaded, isSameNode, isSupported, load, lookupDefaultNamespaceURI, lookupNamespaceURI, lookupPrefix, setDataBytes, setDataBytes, setDataLen, setDataPos, setDirty, setNodeName, setParentNode, setPrefix, setSource, setTextContent, setUserData, toString, unload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setPrefix
 

Constructor Detail

AttrImpl

public AttrImpl()

AttrImpl

public AttrImpl(NodeImpl parentNode,
                byte[] data,
                int pos,
                int len)

AttrImpl

public AttrImpl(NodeImpl parentNode,
                String nodeName,
                String nsURI,
                short symbolID,
                String nodeValue)

AttrImpl

public AttrImpl(NodeImpl parentNode,
                boolean dirty)

AttrImpl

public AttrImpl(NodeImpl parentNode,
                String nodeName)
Method Detail

getNodeType

public short getNodeType()
Description copied from class: NodeImpl
A code representing the type of the underlying object, as defined above.
Specified by:
getNodeType in interface org.w3c.dom.Node
Overrides:
getNodeType in class NodeImpl

getName

public String getName()
Returns the name of this attribute.
Specified by:
getName in interface org.w3c.dom.Attr

setSymbolID

public void setSymbolID(short symbolID)

getSymbolID

public short getSymbolID()
Description copied from interface: CompressedNode
getSymbolID returns the Symbol ID for the current node. Some nodes will not have a Symbol ID, in which case, a value of -1 is returned.
Overrides:
getSymbolID in class NodeImpl
Following copied from interface: org.apache.xindice.xml.dom.CompressedNode
Returns:
The Symbol ID

setNodeValue

public void setNodeValue(String nodeValue)
                  throws org.w3c.dom.DOMException
Description copied from class: NodeImpl
The value of this node, depending on its type; see the table above. When it is defined to be null , setting it has no effect.
Specified by:
setNodeValue in interface org.w3c.dom.Node
Overrides:
setNodeValue in class NodeImpl
Following copied from class: org.apache.xindice.xml.dom.NodeImpl
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
org.w3c.dom.DOMException - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.

setValue

public void setValue(String value)
Specified by:
setValue in interface org.w3c.dom.Attr

isNodeTypeValid

protected boolean isNodeTypeValid(short type)
Overrides:
isNodeTypeValid in class ContainerNodeImpl

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 org.w3c.dom.Attr

setSpecified

public void setSpecified(boolean specified)

getValue

public String getValue()
On retrieval, the value of the attribute is returned as a string. Character and general entity references are replaced with their values.
On setting, this creates a Text node with the unparsed contents of the string.
Specified by:
getValue in interface org.w3c.dom.Attr

getNodeValue

public String getNodeValue()
Description copied from class: NodeImpl
The value of this node, depending on its type; see the table above.
Specified by:
getNodeValue in interface org.w3c.dom.Node
Overrides:
getNodeValue in class NodeImpl
Following copied from class: org.apache.xindice.xml.dom.NodeImpl
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
org.w3c.dom.DOMException - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.

getOwnerElement

public org.w3c.dom.Element getOwnerElement()
Specified by:
getOwnerElement in interface org.w3c.dom.Attr
Since:
DOM Level 2

getSchemaTypeInfo

public org.w3c.dom.TypeInfo getSchemaTypeInfo()
Since:
DOM Level 3

isId

public boolean isId()
Since:
DOM Level 3

Xindice API
version 1.1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.