public class UserDataAttribute extends DefaultAttribute
UserDataAttribute
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.
Modifier and Type | Field and Description |
---|---|
private Object |
data
The user data object
|
value
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 and Description |
---|
UserDataAttribute(QName qname) |
UserDataAttribute(QName qname,
String text) |
Modifier and Type | Method and Description |
---|---|
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(Object data)
Sets the data value of this attribute if this element supports data
binding or calls
Node.setText(java.lang.String) if it doesn't |
getParent, isReadOnly, setParent, setValue, supportsParent
getQName, getValue
accept, asXML, createXPathResult, getName, getNamespace, getNamespacePrefix, getNamespaceURI, getNodeType, getPath, getQualifiedName, getText, getUniquePath, setNamespace, setText, toString, write
asXPathResult, clone, createPattern, createXPath, createXPathFilter, detach, getDocument, getDocumentFactory, getNodeTypeName, getPath, getStringValue, getUniquePath, hasContent, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, valueOf
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asXPathResult, clone, createXPath, detach, getDocument, getNodeTypeName, getPath, getStringValue, getUniquePath, hasContent, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, valueOf
public UserDataAttribute(QName qname)
public UserDataAttribute(QName qname, String text)
public Object getData()
Attribute
Node.getText()
getData
in interface Attribute
getData
in class AbstractAttribute
public void setData(Object data)
Attribute
Node.setText(java.lang.String)
if it doesn'tsetData
in interface Attribute
setData
in class AbstractAttribute
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses