Package org.dom4j.tree
Class FlyweightAttribute
- java.lang.Object
-
- org.dom4j.tree.AbstractNode
-
- org.dom4j.tree.AbstractAttribute
-
- org.dom4j.tree.FlyweightAttribute
-
- Direct Known Subclasses:
DefaultAttribute
public class FlyweightAttribute extends AbstractAttribute
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.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
value
The value of theAttribute
-
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 FlyweightAttribute(java.lang.String name, java.lang.String value)
Creates theAttribute
with the specified local name and value.FlyweightAttribute(java.lang.String name, java.lang.String value, Namespace namespace)
Creates theAttribute
with the specified local name, value andNamespace
.FlyweightAttribute(QName qname)
FlyweightAttribute(QName qname, java.lang.String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QName
getQName()
Returns theQName
of this attribute which represents the local name, the qualified name and theNamespace
.java.lang.String
getValue()
Returns the value of the attribute.-
Methods inherited from class org.dom4j.tree.AbstractAttribute
accept, asXML, createXPathResult, getData, getName, getNamespace, getNamespacePrefix, getNamespaceURI, getNodeType, getPath, getQualifiedName, getText, getUniquePath, setData, setNamespace, setText, setValue, toString, write
-
Methods inherited from class org.dom4j.tree.AbstractNode
asXPathResult, clone, createPattern, createXPath, createXPathFilter, detach, getDocument, getDocumentFactory, getNodeTypeName, getParent, 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, getParent, getPath, getStringValue, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, supportsParent, valueOf
-
-
-
-
Constructor Detail
-
FlyweightAttribute
public FlyweightAttribute(QName qname)
-
FlyweightAttribute
public FlyweightAttribute(QName qname, java.lang.String value)
-
FlyweightAttribute
public FlyweightAttribute(java.lang.String name, java.lang.String value)
Creates theAttribute
with the specified local name and value.- Parameters:
name
- is the name of the attributevalue
- is the value of the attribute
-
FlyweightAttribute
public FlyweightAttribute(java.lang.String name, java.lang.String value, Namespace namespace)
Creates theAttribute
with the specified local name, value andNamespace
.- Parameters:
name
- is the name of the attributevalue
- is the value of the attributenamespace
- is the namespace of the attribute
-
-
Method Detail
-
getValue
public java.lang.String 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
-
-