org.dom4j.util
Class UserDataAttribute

java.lang.Object
  extended by org.dom4j.tree.AbstractNode
      extended by org.dom4j.tree.AbstractAttribute
          extended by org.dom4j.tree.FlyweightAttribute
              extended by org.dom4j.tree.DefaultAttribute
                  extended by org.dom4j.util.UserDataAttribute
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Attribute, Node

public class UserDataAttribute
extends org.dom4j.tree.DefaultAttribute

UserDataAttribute support the adornment of a user data object on an Element or Attribute instance such that the methods setData(Object)will get and set the values of a user data object. This can be useful for developers wishing to create XML trees and adorn the trees with user defined objects.

Version:
$Revision: 1.8 $
Author:
James Strachan
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.dom4j.tree.FlyweightAttribute
value
 
Fields inherited from class org.dom4j.tree.AbstractNode
NODE_TYPE_NAMES
 
Fields inherited from interface org.dom4j.Node
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE
 
Constructor Summary
UserDataAttribute(QName qname)
           
UserDataAttribute(QName qname, java.lang.String text)
           
 
Method Summary
 java.lang.Object getData()
           Accesses the data of this attribute which may implement data typing bindings such as XML Schema or Java Bean bindings or will return the same value as Node.getText().
 void setData(java.lang.Object data)
           Sets the data value of this attribute if this element supports data binding or calls Node.setText(String)if it doesn't.
 
Methods inherited from class org.dom4j.tree.DefaultAttribute
getParent, isReadOnly, setParent, setValue, supportsParent
 
Methods inherited from class org.dom4j.tree.FlyweightAttribute
getQName, getValue
 
Methods inherited from class org.dom4j.tree.AbstractAttribute
accept, asXML, createXPathResult, getName, getNamespace, getNamespacePrefix, getNamespaceURI, getNodeType, getPath, getQualifiedName, getText, getUniquePath, setNamespace, setText, toString, write
 
Methods inherited from class org.dom4j.tree.AbstractNode
asXPathResult, clone, createPattern, createXPath, createXPathFilter, detach, getDocument, getDocumentFactory, getNodeTypeName, getPath, getStringValue, getUniquePath, hasContent, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, valueOf
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.dom4j.Node
asXPathResult, clone, createXPath, detach, getDocument, getNodeTypeName, getPath, getStringValue, getUniquePath, hasContent, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, valueOf
 

Constructor Detail

UserDataAttribute

public UserDataAttribute(QName qname)

UserDataAttribute

public UserDataAttribute(QName qname,
                         java.lang.String text)
Method Detail

getData

public java.lang.Object getData()
Description copied from interface: Attribute

Accesses the data of this attribute which may implement data typing bindings such as XML Schema or Java Bean bindings or will return the same value as Node.getText().

Specified by:
getData in interface Attribute
Overrides:
getData in class org.dom4j.tree.AbstractAttribute
Returns:
the attribute data

setData

public void setData(java.lang.Object data)
Description copied from interface: Attribute

Sets the data value of this attribute if this element supports data binding or calls Node.setText(String)if it doesn't.

Specified by:
setData in interface Attribute
Overrides:
setData in class org.dom4j.tree.AbstractAttribute
Parameters:
data - the attribute data


Copyright ? 2005 MetaStuff Ltd. All Rights Reserved. Hosted by

SourceForge Logo