com.japisoft.fastparser.dom
Class AttrImpl

java.lang.Object
  |
  +--com.japisoft.fastparser.node.SimpleNode
        |
        +--com.japisoft.fastparser.dom.NodeImpl
              |
              +--com.japisoft.fastparser.dom.AttrImpl
All Implemented Interfaces:
Attr, MutableNode, Node, ViewableNode

public class AttrImpl
extends NodeImpl
implements Attr

Att

Version:
1.0
Author:
(c) 2002-2003 JAPISOFT

Field Summary
 
Fields inherited from class com.japisoft.fastparser.dom.NodeImpl
nameSpaceURI
 
Fields inherited from class com.japisoft.fastparser.node.SimpleNode
COMMENT_NODE, TAG_NODE, TEXT_NODE
 
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(java.lang.String name, SimpleNode ref)
           
 
Method Summary
 java.lang.String getName()
          Returns the name of this attribute.
 Element getOwnerElement()
           
 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()
          On retrieval, the value of the attribute is returned as a string.
 void setValue(java.lang.String value)
           
 
Methods inherited from class com.japisoft.fastparser.dom.NodeImpl
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNamespaceURI, setNodeValue, setOwnerDocument, setPrefix
 
Methods inherited from class com.japisoft.fastparser.node.SimpleNode
addChildNode, addNameSpaceDeclaration, addNode, childAt, childCount, childNodeIndex, clone, getAllChild, getAttribute, getAttribute, getContent, getDefaultNamespace, getDocument, getLine, getNameSpaceDeclaration, getNameSpaceDeclarationURI, getNamespaceDeclared, getNameSpacePrefix, getNameSpaceURI, getNodeByCriteria, getNodeByName, getNodeContent, getNodeForXPathLocation, getSimpleParent, getType, getViewAttribute, getViewAttributes, getViewChildAt, getViewChildCount, getViewContent, getXPathLocation, getXPathLocation, hasAttribute, insertChildNode, isComment, isLeaf, isNamespaceDeclared, isRoot, isTag, isText, isViewComment, isViewLeaf, isViewText, removeChildNode, removeNameSpaceDeclaration, setAttribute, setContent, setDefaultNamespace, setDocument, setLine, setNameSpace, setNodeAttribute, setNodeContent, setNodeParent, setSimpleParent, setType, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, removeChild, replaceChild, setNodeValue
 

Constructor Detail

AttrImpl

public AttrImpl(java.lang.String name,
                SimpleNode ref)
Parameters:
name - Attribute name
ref - Reference node
Method Detail

getName

public java.lang.String getName()
Returns the name of this attribute.

Specified by:
getName in interface Attr

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

getValue

public java.lang.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 Attr

setValue

public void setValue(java.lang.String value)
Specified by:
setValue in interface Attr

getOwnerElement

public Element getOwnerElement()