public class UserDataElement extends DefaultElement
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.
DEFAULT_CONTENT_LIST_SIZE
USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRING
NODE_TYPE_NAMES
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 | Description |
---|---|
UserDataElement(java.lang.String name) |
|
UserDataElement(QName qname) |
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
clone() |
clone will return a deep clone or if this node is
read-only then clone will return the same instance. |
protected Element |
createElement(java.lang.String name) |
|
protected Element |
createElement(QName qName) |
|
protected java.lang.Object |
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
|
java.lang.Object |
getData() |
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 as
Element.getText() |
void |
setData(java.lang.Object data) |
Sets the data value of this element if this element supports data binding
or calls
Node.setText(java.lang.String) if it doesn't |
java.lang.String |
toString() |
addElement, addElement, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getTextTrim, hasContent, invalidNodeTypeAddException, isReadOnly, setProcessingInstructions
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, 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, childAdded, childRemoved, isRootElement, isTextOnly, normalize, remove, remove, remove, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setName, setNamespace, setText, write
asXPathResult, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf
addElement, addElement, appendContent, content, elementByID, setProcessingInstructions
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, supportsParent
getTextTrim
asXPathResult, createXPath, detach, getNodeTypeName, getPath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf
public UserDataElement(java.lang.String name)
public UserDataElement(QName qname)
public java.lang.Object getData()
Element
Element.getText()
getData
in interface Element
getData
in class AbstractElement
public void setData(java.lang.Object data)
Element
Node.setText(java.lang.String)
if it doesn'tsetData
in interface Element
setData
in class AbstractElement
data
- DOCUMENT ME!public java.lang.String toString()
toString
in class AbstractElement
public java.lang.Object clone()
Node
clone
will return a deep clone or if this node is
read-only then clone will return the same instance.
clone
in interface Node
clone
in class DefaultElement
protected java.lang.Object getCopyOfUserData()
protected Element createElement(java.lang.String name)
createElement
in class AbstractElement
protected Element createElement(QName qName)
createElement
in class AbstractElement