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
public class BeanAttribute extends AbstractAttribute
BeanAttributerepresents a mutable XML attribute which is backed by a property of the JavaBean of its parent element.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields 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 Constructor Description BeanAttribute(BeanAttributeList beanList, int index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetData()Accesses the data of this attribute which may implement data typing bindings such asXML SchemaorJava Beanbindings or will return the same value asNode.getText().ElementgetParent()getParentreturns the parentElementif this node supports the parent relationship or null if it is the root element or does not support the parent relationship.QNamegetQName()Returns theQNameof this attribute which represents the local name, the qualified name and theNamespace.StringgetValue()Returns the value of the attribute.voidsetData(Object data)Sets the data value of this attribute if this element supports data binding or callsNode.setText(String)if it doesn't.voidsetValue(String data)Sets the value of this attribute or this method will throw anUnsupportedOperationExceptionif 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
-
-
-
-
Constructor Detail
-
BeanAttribute
public BeanAttribute(BeanAttributeList beanList, int index)
-
-
Method Detail
-
getQName
public QName getQName()
Description copied from interface:AttributeReturns theQNameof this attribute which represents the local name, the qualified name and theNamespace.- Returns:
- the
QNameassociated with this attribute
-
getParent
public Element getParent()
Description copied from interface:NodegetParentreturns the parentElementif 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
Nodeimplementations.- Specified by:
getParentin interfaceNode- Overrides:
getParentin 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
public String getValue()
Description copied from interface:AttributeReturns the value of the attribute. This method returns the same value as theNode.getText()method.- Returns:
- the value of the attribute
-
setValue
public void setValue(String data)
Description copied from interface:AttributeSets the value of this attribute or this method will throw anUnsupportedOperationExceptionif it is read-only.- Specified by:
setValuein interfaceAttribute- Overrides:
setValuein classAbstractAttribute- Parameters:
data- is the new value of this attribute
-
getData
public Object getData()
Description copied from interface:AttributeAccesses the data of this attribute which may implement data typing bindings such asXML SchemaorJava Beanbindings or will return the same value asNode.getText().- Specified by:
getDatain interfaceAttribute- Overrides:
getDatain classAbstractAttribute- Returns:
- the attribute data
-
setData
public void setData(Object data)
Description copied from interface:AttributeSets the data value of this attribute if this element supports data binding or callsNode.setText(String)if it doesn't.- Specified by:
setDatain interfaceAttribute- Overrides:
setDatain classAbstractAttribute- Parameters:
data- the attribute data
-
-