Top Description Fields Methods
org.dom4j

public Interface Attribute

extends Node
Known Direct Implementers
org.dom4j.tree.AbstractAttribute
Annotations
@SuppressWarnings:unused

Attribute defines an XML attribute. An attribute may have a name, an optional namespace and a value.
Author
James Strachan
Version
$Revision: 1.9 $

Field Summary

Inherited from org.dom4j.Node:
ANY_NODEATTRIBUTE_NODECDATA_SECTION_NODECOMMENT_NODEDOCUMENT_NODEDOCUMENT_TYPE_NODEELEMENT_NODEENTITY_REFERENCE_NODEMAX_NODE_TYPENAMESPACE_NODEPROCESSING_INSTRUCTION_NODETEXT_NODEUNKNOWN_NODE

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the attribute data
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 Namespace

Returns:

the Namespace associated with this node
getNamespace
()

Returns the Namespace of this element if one exists otherwise null is returned returned.

public String

Returns:

the prefix of the Namespace of this element or an empty String
getNamespacePrefix
()

Returns the namespace prefix of this element if one exists otherwise an empty String is returned.

public String

Returns:

the URI for the Namespace of this element or an empty String
getNamespaceURI
()

Returns the URI mapped to the namespace of this element if one exists otherwise an empty String is returned.

public QName

Returns:

the QName associated with this attribute
getQName
()

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

public String

Returns:

the fully qualified name of the element
getQualifiedName
()

Returns the fully qualified name of this element.

public String

Returns:

the value of the attribute
getValue
()

Returns the value of the attribute.

public void
setData(Object
the attribute data
data
)

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

public void
setNamespace(Namespace
is the Namespace to associate with this element
namespace
)

Sets the Namespace of this element or if this element is read only then an UnsupportedOperationException is thrown.

public void
setValue(String
is the new value of this attribute
value
)

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

Inherited from org.dom4j.Node:
acceptasXMLasXPathResultclonecreateXPathdetachgetDocumentgetNamegetNodeTypegetNodeTypeNamegetParentgetPathgetPathgetStringValuegetTextgetUniquePathgetUniquePathhasContentisReadOnlymatchesnumberValueOfselectNodesselectNodesselectNodesselectObjectselectSingleNodesetDocumentsetNamesetParentsetTextsupportsParentvalueOfwrite

Method Detail

getDataback to summary
public 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().

Returns:Object

the attribute data

getNamespaceback to summary
public Namespace getNamespace()

Returns the Namespace of this element if one exists otherwise null is returned returned.

Returns:Namespace

the Namespace associated with this node

getNamespacePrefixback to summary
public String getNamespacePrefix()

Returns the namespace prefix of this element if one exists otherwise an empty String is returned.

Returns:String

the prefix of the Namespace of this element or an empty String

getNamespaceURIback to summary
public String getNamespaceURI()

Returns the URI mapped to the namespace of this element if one exists otherwise an empty String is returned.

Returns:String

the URI for the Namespace of this element or an empty String

getQNameback to summary
public QName 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

getQualifiedNameback to summary
public String getQualifiedName()

Returns the fully qualified name of this element. This will be the same as the value returned from Node#getName() if this element has no namespace attached to this element or an expression of the form

getNamespacePrefix() + ":" + getName()
will be returned.
Returns:String

the fully qualified name of the element

getValueback to summary
public String 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)

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

setNamespaceback to summary
public void setNamespace(Namespace namespace)

Sets the Namespace of this element or if this element is read only then an UnsupportedOperationException is thrown.

Parameters
namespace:Namespace

is the Namespace to associate with this element

setValueback to summary
public void setValue(String value)

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

Parameters
value:String

is the new value of this attribute