public class BeanAttribute extends AbstractAttribute
BeanAttribute
represents a mutable XML attribute which
is backed by a property of the JavaBean of its parent element.
Modifier and Type | Field and Description |
---|---|
private BeanAttributeList |
beanList
The list of Bean attributes
|
private int |
index
The index in the Bean attribute list
|
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 |
---|
BeanAttribute(BeanAttributeList beanList,
int index) |
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() |
Element |
getParent()
getParent returns the parent Element
if this node supports the parent relationship or null if it is
the root element or does not support the parent relationship. |
QName |
getQName()
Returns the
QName of this attribute which represents
the local name, the qualified name and the Namespace . |
String |
getValue()
Returns the value of the attribute.
|
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 |
void |
setValue(String data)
Sets the value of this attribute or this method will
throw an
UnsupportedOperationException if it is
read-only. |
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, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, supportsParent, valueOf
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asXPathResult, clone, createXPath, detach, getDocument, getNodeTypeName, getPath, getStringValue, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, supportsParent, valueOf
private final BeanAttributeList beanList
private final int index
public BeanAttribute(BeanAttributeList beanList, int index)
public QName getQName()
Attribute
Returns the QName
of this attribute which represents
the local name, the qualified name and the Namespace
.
QName
associated with this attributepublic Element getParent()
Node
getParent
returns the parent Element
if this node supports the parent relationship or null if it is
the root element or does not support the parent relationship.
This method is an optional feature and may not be supported
for all Node
implementations.
getParent
in interface Node
getParent
in class AbstractNode
public String getValue()
Attribute
Returns the value of the attribute. This method
returns the same value as the Node.getText()
method.
public void setValue(String data)
Attribute
Sets the value of this attribute or this method will
throw an UnsupportedOperationException
if it is
read-only.
setValue
in interface Attribute
setValue
in class AbstractAttribute
data
- is the new value of this attributepublic 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