Package snap.util

Class XMLAttribute

java.lang.Object
snap.util.XMLAttribute
All Implemented Interfaces:
Cloneable

public class XMLAttribute extends Object implements Cloneable
This class represents an XML attribute by simply having a name and value. It also forms the super class of RXElement
  • Constructor Details

    • XMLAttribute

      public XMLAttribute()
      Creates an empty attribute.
    • XMLAttribute

      public XMLAttribute(String aName, String aValue)
      Creates an attribute initialized with the given name and value.
    • XMLAttribute

      public XMLAttribute(String aName, boolean aValue)
      Creates an attribute initialized with the given name and boolean value.
    • XMLAttribute

      public XMLAttribute(String aName, Boolean aValue)
      Creates an attribute initialized with the given name and Boolean value.
    • XMLAttribute

      public XMLAttribute(String aName, int aValue)
      Creates an attribute initialized with the given name and int value.
    • XMLAttribute

      public XMLAttribute(String aName, double aValue)
      Creates an attribute initialized with the given name and float value.
  • Method Details

    • getName

      public String getName()
      Returns the name for this attribute.
    • setName

      public void setName(String aName)
      Sets the name for this attribute.
    • getFullName

      public String getFullName()
      Returns the full name for this attribute.
    • setFullName

      public void setFullName(String aName)
      Sets the full name for this attribute.
    • getPrefix

      public String getPrefix()
      Returns the prefix if full name is different.
    • getValue

      public String getValue()
      Returns the value for this attribute.
    • setValue

      public void setValue(String aValue)
      Sets the value for this attribute.
    • getIntValue

      public int getIntValue()
      Returns the value for this attribute as an int.
    • getFloatValue

      public float getFloatValue()
      Returns the value for this attribute as a float.
    • getDoubleValue

      public double getDoubleValue()
      Returns the value for this attribute as a float.
    • getNumberValue

      public Number getNumberValue()
      Returns value for the attribute as a Number (can be any of Integer, Double, etc).
    • clone

      public XMLAttribute clone()
      Returns a clone of this attribute.
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Returns a basic string representation of this attribute.
      Overrides:
      toString in class Object