com.teamkonzept.dom4jb.dom
Class Attribute

java.lang.Object
  |
  +--com.teamkonzept.dom4jb.dom.NodeList
        |
        +--com.teamkonzept.dom4jb.dom.Node
              |
              +--com.teamkonzept.dom4jb.dom.NamedNode
                    |
                    +--com.teamkonzept.dom4jb.dom.Attribute
All Implemented Interfaces:
Attr, Node, NodeList
Direct Known Subclasses:
Attribute

public class Attribute
extends NamedNode
implements Attr


Field Summary
 
Fields inherited from class com.teamkonzept.dom4jb.dom.Node
document
 
Fields inherited from class com.teamkonzept.dom4jb.dom.NodeList
EMPTY, initialCapacity, nodeData, nodeIterator, parent, size
 
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
Attribute(Document document, AttributeDescriptor descriptor, Object bean)
          Creates new Attribute
 
Method Summary
 boolean accept(Filter filter)
           
 int getChildIndex()
           
 String getName()
          Returns the name of this attribute.
 short getNodeType()
          A code representing the type of the Attribute
 String getNodeValue()
          The value of this node, depending on its type; see the table above.
 Element getOwnerElement()
          The Element node this attribute is attached to or null if this attribute is not in use.
 Node getParentNode()
          The parent of this node.
 boolean getSpecified()
          If this attribute was explicitly given a value in the original document, this is true; otherwise, it is false.
 String getValue()
          On retrieval, the value of the attribute is returned as a string.
 void setValue(String value)
          On retrieval, the value of the attribute is returned as a string.
 
Methods inherited from class com.teamkonzept.dom4jb.dom.NamedNode
getLocalName, getNamespaceURI, getNamingItem, getNodeName, getPrefix, setPrefix
 
Methods inherited from class com.teamkonzept.dom4jb.dom.Node
appendChild, attach, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextSibling, getOwnerDocument, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue
 
Methods inherited from class com.teamkonzept.dom4jb.dom.NodeList
add, clear, ensureCapacity, get, getLength, isEmpty, item, setIterator, setParentNode, size, trimToSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getOwnerDocument, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Constructor Detail

Attribute

public Attribute(Document document,
                 AttributeDescriptor descriptor,
                 Object bean)
Creates new Attribute

Method Detail

getChildIndex

public int getChildIndex()
Overrides:
getChildIndex in class Node

getNodeType

public final short getNodeType()
A code representing the type of the Attribute

Specified by:
getNodeType in interface Node
Returns:
Node.ATTRIBUTE_NODE

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.If the ownerElement attribute is null (i.e. because it was just created or was set to null by the various removal and cloning operations) specified is true.

Specified by:
getSpecified in interface Attr

getName

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

Specified by:
getName in interface Attr

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
Since:
DOM Level 2

setValue

public void setValue(String value)
On retrieval, the value of the attribute is returned as a string. Character and general entity references are replaced with their values. See also the method getAttribute on the Element interface.
On setting, this creates a Text node with the unparsed contents of the string. I.e. any characters that an XML processor would recognize as markup are instead treated as literal text. See also the method setAttribute on the Element interface.

Specified by:
setValue in interface Attr

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. See also the method getAttribute on the Element interface.
On setting, this creates a Text node with the unparsed contents of the string. I.e. any characters that an XML processor would recognize as markup are instead treated as literal text. See also the method setAttribute on the Element interface.

Specified by:
getValue in interface Attr

getNodeValue

public String getNodeValue()
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:
getNodeValue in interface Node
Overrides:
getNodeValue in class Node

getParentNode

public Node getParentNode()
The parent of this node. Attr may have not a parent.

Specified by:
getParentNode in interface Node
Overrides:
getParentNode in class NodeList

accept

public boolean accept(Filter filter)
Specified by:
accept in class Node
See Also:
Node.accept(Filter)


Copyright © 2001-2003 Team-Konzept GmbH & CO KG. All Rights Reserved.