Top Description Fields Constructors Methods
org.dom4j.tree

public Class FlyweightAttribute

extends AbstractAttribute
Class Inheritance
Known Direct Subclasses
org.dom4j.tree.DefaultAttribute
Imports
org.dom4j.Namespace, .QName

FlyweightAttribute is a Flyweight pattern implementation of a singly linked, read-only XML Attribute.

This node could be shared across documents and elements though it does not support the parent relationship.

Author
James Strachan
Version
$Revision: 1.7 $

Field Summary

Modifier and TypeField and Description
private QName
qname

The QName for this element

protected String
value

The value of the Attribute

Constructor Summary

AccessConstructor and Description
public
public
public
FlyweightAttribute(String
is the name of the attribute
name
,
String
is the value of the attribute
value
)

Creates the Attribute with the specified local name and value.

public
FlyweightAttribute(String
is the name of the attribute
name
,
String
is the value of the attribute
value
,
Namespace
is the namespace of the attribute
namespace
)

Creates the Attribute with the specified local name, value and Namespace.

Method Summary

Modifier and TypeMethod and Description
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.
Inherited from org.dom4j.tree.AbstractAttribute:
acceptasXMLcreateXPathResultgetDatagetNamegetNamespacegetNamespacePrefixgetNamespaceURIgetNodeTypegetPathgetQualifiedNamegetTextgetUniquePathsetDatasetNamespacesetTextsetValuetoStringwrite

Field Detail

qnameback to summary
private QName qname

The QName for this element

valueback to summary
protected String value

The value of the Attribute

Constructor Detail

FlyweightAttributeback to summary
public FlyweightAttribute(QName qname)
FlyweightAttributeback to summary
public FlyweightAttribute(QName qname, String value)
FlyweightAttributeback to summary
public FlyweightAttribute(String name, String value)

Creates the Attribute with the specified local name and value.

Parameters
name:String

is the name of the attribute

value:String

is the value of the attribute

FlyweightAttributeback to summary
public FlyweightAttribute(String name, String value, Namespace namespace)

Creates the Attribute with the specified local name, value and Namespace.

Parameters
name:String

is the name of the attribute

value:String

is the value of the attribute

namespace:Namespace

is the namespace of the attribute

Method Detail

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