Top Description Fields Constructors Methods
org.dom4j.bean

public Class BeanAttribute

extends AbstractAttribute
Class Inheritance
Imports
org.dom4j.Element, .QName, org.dom4j.tree.AbstractAttribute

BeanAttribute represents a mutable XML attribute which is backed by a property of the JavaBean of its parent element.

Author
James Strachan
Version
$Revision: 1.7 $

Field Summary

Modifier and TypeField and Description
private final BeanAttributeList
beanList

The list of Bean attributes

private final int
index

The index in the Bean attribute list

Constructor Summary

AccessConstructor and Description
public
BeanAttribute(BeanAttributeList beanList, int index)

Method Summary

Modifier and TypeMethod and Description
public Object
getData()

Overrides org.dom4j.tree.AbstractAttribute.getData.

Implements org.dom4j.Attribute.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().
public Element
getParent()

Overrides org.dom4j.tree.AbstractNode.getParent.

Implements org.dom4j.Node.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.

public QName
getQName()

Implements org.dom4j.Attribute.getQName.

Returns the QName of this attribute which represents the local name, the qualified name and the Namespace.
public String
getValue()

Implements org.dom4j.Attribute.getValue.

Returns the value of the attribute.
public void
setData(Object
the attribute data
data
)

Overrides org.dom4j.tree.AbstractAttribute.setData.

Implements org.dom4j.Attribute.setData.

Sets the data value of this attribute if this element supports data binding or calls Node#setText(String)if it doesn't.
public void
setValue(String
is the new value of this attribute
data
)

Overrides org.dom4j.tree.AbstractAttribute.setValue.

Implements org.dom4j.Attribute.setValue.

Sets the value of this attribute or this method will throw an UnsupportedOperationException if it is read-only.
Inherited from org.dom4j.tree.AbstractAttribute:
acceptasXMLcreateXPathResultgetNamegetNamespacegetNamespacePrefixgetNamespaceURIgetNodeTypegetPathgetQualifiedNamegetTextgetUniquePathsetNamespacesetTexttoStringwrite

Field Detail

beanListback to summary
private final BeanAttributeList beanList

The list of Bean attributes

indexback to summary
private final int index

The index in the Bean attribute list

Constructor Detail

BeanAttributeback to summary
public BeanAttribute(BeanAttributeList beanList, int index)

Method Detail

getDataback to summary
public Object getData()

Overrides org.dom4j.tree.AbstractAttribute.getData.

Implements org.dom4j.Attribute.getData.

Doc from org.dom4j.Attribute.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().

Returns:Object

the attribute data

getParentback to summary
public Element getParent()

Overrides org.dom4j.tree.AbstractNode.getParent.

Implements org.dom4j.Node.getParent.

Doc from org.dom4j.Node.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.

This method is an optional feature and may not be supported for all Node implementations.

Returns:Element

the parent of this node or null if it is the root of the tree or the parent relationship is not supported.

getQNameback to summary
public QName getQName()

Implements org.dom4j.Attribute.getQName.

Doc from org.dom4j.Attribute.getQName.

Returns the QName of this attribute which represents the local name, the qualified name and the Namespace.

Returns:QName

the QName associated with this attribute

getValueback to summary
public String getValue()

Implements org.dom4j.Attribute.getValue.

Doc from org.dom4j.Attribute.getValue.

Returns the value of the attribute. This method returns the same value as the Node#getText()method.

Returns:String

the value of the attribute

setDataback to summary
public void setData(Object data)

Overrides org.dom4j.tree.AbstractAttribute.setData.

Implements org.dom4j.Attribute.setData.

Doc from org.dom4j.Attribute.setData.

Sets the data value of this attribute if this element supports data binding or calls Node#setText(String)if it doesn't.

Parameters
data:Object

the attribute data

setValueback to summary
public void setValue(String data)

Overrides org.dom4j.tree.AbstractAttribute.setValue.

Implements org.dom4j.Attribute.setValue.

Doc from org.dom4j.Attribute.setValue.

Sets the value of this attribute or this method will throw an UnsupportedOperationException if it is read-only.

Parameters
data:String

is the new value of this attribute