Package org.dom4j.bean
Class BeanAttribute
java.lang.Object
org.dom4j.tree.AbstractNode
org.dom4j.tree.AbstractAttribute
org.dom4j.bean.BeanAttribute
- All Implemented Interfaces:
Serializable
,Cloneable
,Attribute
,Node
BeanAttribute
represents a mutable XML attribute which is
backed by a property of the JavaBean of its parent element.
- Version:
- $Revision: 1.7 $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BeanAttributeList
The list of Bean attributesprivate final int
The index in the Bean attribute listFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetData()
Accesses the data of this attribute which may implement data typing bindings such asXML Schema
orJava Bean
bindings or will return the same value asNode.getText()
.getParent
returns the parentElement
if this node supports the parent relationship or null if it is the root element or does not support the parent relationship.getQName()
Returns theQName
of this attribute which represents the local name, the qualified name and theNamespace
.getValue()
Returns the value of the attribute.void
Sets the data value of this attribute if this element supports data binding or callsNode.setText(String)
if it doesn't.void
Sets the value of this attribute or this method will throw anUnsupportedOperationException
if it is read-only.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, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, supportsParent, 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, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, supportsParent, valueOf
-
Field Details
-
beanList
The list of Bean attributes -
index
private final int indexThe index in the Bean attribute list
-
-
Constructor Details
-
BeanAttribute
-
-
Method Details
-
getQName
Description copied from interface:Attribute
Returns theQName
of this attribute which represents the local name, the qualified name and theNamespace
.- Returns:
- the
QName
associated with this attribute
-
getParent
Description copied from interface:Node
getParent
returns the parentElement
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.- Specified by:
getParent
in interfaceNode
- Overrides:
getParent
in classAbstractNode
- Returns:
- the parent of this node or null if it is the root of the tree or the parent relationship is not supported.
-
getValue
Description copied from interface:Attribute
Returns the value of the attribute. This method returns the same value as theNode.getText()
method.- Returns:
- the value of the attribute
-
setValue
Description copied from interface:Attribute
Sets the value of this attribute or this method will throw anUnsupportedOperationException
if it is read-only.- Specified by:
setValue
in interfaceAttribute
- Overrides:
setValue
in classAbstractAttribute
- Parameters:
data
- is the new value of this attribute
-
getData
Description copied from interface:Attribute
Accesses the data of this attribute which may implement data typing bindings such asXML Schema
orJava Bean
bindings or will return the same value asNode.getText()
.- Specified by:
getData
in interfaceAttribute
- Overrides:
getData
in classAbstractAttribute
- Returns:
- the attribute data
-
setData
Description copied from interface:Attribute
Sets the data value of this attribute if this element supports data binding or callsNode.setText(String)
if it doesn't.- Specified by:
setData
in interfaceAttribute
- Overrides:
setData
in classAbstractAttribute
- Parameters:
data
- the attribute data
-