Class FlyweightAttribute

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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.

    See Also:
    Serialized Form
    • Field Detail

      • value

        protected java.lang.String value
        The value of the Attribute
    • 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 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​(java.lang.String name,
                                  java.lang.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 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 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