Class UserDataElement
java.lang.Object
org.dom4j.tree.AbstractNode
org.dom4j.tree.AbstractBranch
org.dom4j.tree.AbstractElement
org.dom4j.tree.DefaultElement
org.dom4j.util.UserDataElement
- All Implemented Interfaces:
Serializable, Cloneable, Branch, Element, Node
UserDataElement support the adornment of a user data object on
an Element or Attribute instance such that the methods getData()
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.12 $
- See Also:
-
Field Summary
FieldsFields inherited from class AbstractElement
USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRINGFields inherited from class AbstractBranch
DEFAULT_CONTENT_LIST_SIZEFields inherited from class AbstractNode
NODE_TYPE_NAMESFields inherited from interface 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()clonewill return a deep clone or if this node is read-only then clone will return the same instance.protected ElementcreateElement(String name) protected ElementcreateElement(QName qName) protected ObjectIf a deep copy of user data is required whenever the clone() or createCopy() methods are called on this element then this method should return a clone of the user datagetData()Accesses the data of this element which may implement data typing bindings such as XML Schema or Java Bean bindings or will return the same value asElement.getText()voidSets the data value of this element if this element supports data binding or callsNode.setText(String)if it doesn'ttoString()Methods inherited from class DefaultElement
add, additionalNamespaces, additionalNamespaces, addNewNode, attribute, attribute, attribute, attribute, attributeCount, attributeIterator, attributeList, attributeList, attributes, clearContent, contentList, declaredNamespaces, element, element, element, getDocument, getDocumentFactory, getNamespaceForPrefix, getNamespaceForURI, getParent, getQName, getStringValue, getText, indexOf, node, nodeCount, nodeIterator, processingInstruction, processingInstructions, processingInstructions, remove, removeNode, removeProcessingInstruction, setAttributeList, setAttributes, setContent, setDocument, setParent, setQName, supportsParentMethods inherited from class AbstractElement
accept, add, add, add, add, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addElement, addEntity, addNamespace, addNewNode, addNode, addNode, addProcessingInstruction, addProcessingInstruction, addText, appendAttributes, asXML, attributeValue, attributeValue, attributeValue, attributeValue, childAdded, childRemoved, createAttributeList, createAttributeList, createCopy, createCopy, createCopy, createSingleIterator, elementIterator, elementIterator, elementIterator, elementIterator, elements, elements, elements, elements, elementText, elementText, elementTextTrim, elementTextTrim, ensureAttributesCapacity, getName, getNamespace, getNamespacePrefix, getNamespacesForURI, getNamespaceURI, getNodeType, getPath, getQName, getQualifiedName, getUniquePath, getXPathNameStep, getXPathResult, hasMixedContent, isRootElement, isTextOnly, normalize, remove, remove, remove, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setName, setNamespace, setText, writeMethods inherited from class AbstractBranch
addElement, addElement, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getTextTrim, hasContent, invalidNodeTypeAddException, isReadOnly, setProcessingInstructionsMethods inherited from class AbstractNode
asXPathResult, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOfMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Branch
addElement, addElement, appendContent, content, elementByID, setProcessingInstructionsMethods inherited from interface Element
getTextTrimMethods inherited from interface Node
asXPathResult, createXPath, detach, getNodeTypeName, getPath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf
-
Field Details
-
data
The user data object
-
-
Constructor Details
-
UserDataElement
-
UserDataElement
-
-
Method Details
-
getData
Description copied from interface:ElementAccesses the data of this element which may implement data typing bindings such as XML Schema or Java Bean bindings or will return the same value asElement.getText()- Specified by:
getDatain interfaceElement- Overrides:
getDatain classAbstractElement- Returns:
- DOCUMENT ME!
-
setData
Description copied from interface:ElementSets the data value of this element if this element supports data binding or callsNode.setText(String)if it doesn't- Specified by:
setDatain interfaceElement- Overrides:
setDatain classAbstractElement- Parameters:
data- DOCUMENT ME!
-
toString
- Overrides:
toStringin classAbstractElement
-
clone
Description copied from interface:Nodeclonewill return a deep clone or if this node is read-only then clone will return the same instance.- Specified by:
clonein interfaceNode- Overrides:
clonein classDefaultElement- Returns:
- a deep clone of myself or myself if I am read only.
-
getCopyOfUserData
If a deep copy of user data is required whenever the clone() or createCopy() methods are called on this element then this method should return a clone of the user data- Returns:
- DOCUMENT ME!
-
createElement
- Overrides:
createElementin classAbstractElement
-
createElement
- Overrides:
createElementin classAbstractElement
-