java.lang.Object
org.cybergarage.xml.Attribute

public class Attributeextends Object
Represents an XML attribute with name and value.

This class provides a simple container for XML attribute name-value pairs. Attributes can be created independently or copied from existing attributes.

  • Field Details

    • name

      private String name
      The attribute's name.
    • value

      private String value
      The attribute's value.
  • Constructor Details

    • Attribute

      public Attribute()
      Creates an empty Attribute with empty name and value.
    • Attribute

      public Attribute(String name, String value)
      Creates an Attribute with the specified name and value.
      Parameters:
      name - the attribute name
      value - the attribute value
    • Attribute

      public Attribute(Attribute otherAttr)
      Creates a copy of an existing Attribute.
      Parameters:
      otherAttr - the attribute to copy
  • Method Details

    • setName

      public void setName(String name)
      Sets the name of this attribute.
      Parameters:
      name - the attribute name
    • getName

      public String getName()
      Gets the name of this attribute.
      Returns:
      the attribute name
    • setValue

      public void setValue(String value)
      Sets the value of this attribute.
      Parameters:
      value - the attribute value
    • getValue

      public String getValue()
      Gets the value of this attribute.
      Returns:
      the attribute value
    • set

      public void set(Attribute otherAttr)
      Copies the name and value from another attribute to this attribute.
      Parameters:
      otherAttr - the attribute to copy from