Class FlyweightAttribute

All Implemented Interfaces:
Serializable, Cloneable, Attribute, Node
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.

Version:
$Revision: 1.7 $
See Also:
  • Field Details

    • qname

      private QName qname
      The QName for this element
    • value

      protected String value
      The value of the Attribute
  • Constructor Details

    • FlyweightAttribute

      public FlyweightAttribute(QName qname)
    • FlyweightAttribute

      public FlyweightAttribute(QName qname, String value)
    • FlyweightAttribute

      public FlyweightAttribute(String name, String value)
      Creates the Attribute with the specified local name and value.
      Parameters:
      name - is the name of the attribute
      value - is the value of the attribute
    • FlyweightAttribute

      public FlyweightAttribute(String name, String value, Namespace namespace)
      Creates the Attribute with the specified local name, value and Namespace.
      Parameters:
      name - is the name of the attribute
      value - is the value of the attribute
      namespace - is the namespace of the attribute
  • Method Details

    • getValue

      public String getValue()
      Description copied from interface: Attribute
      Returns the value of the attribute. This method returns the same value as the Node.getText()method.
      Returns:
      the value of the attribute
    • getQName

      public QName getQName()
      Description copied from interface: Attribute
      Returns the QName of this attribute which represents the local name, the qualified name and the Namespace.
      Returns:
      the QName associated with this attribute