Package snap.util
Class XMLAttribute
java.lang.Object
snap.util.XMLAttribute
- All Implemented Interfaces:
Cloneable
This class represents an XML attribute by simply having a name and value.
It also forms the super class of RXElement
-
Constructor Summary
ConstructorDescriptionCreates an empty attribute.XMLAttribute
(String aName, boolean aValue) Creates an attribute initialized with the given name and boolean value.XMLAttribute
(String aName, double aValue) Creates an attribute initialized with the given name and float value.XMLAttribute
(String aName, int aValue) Creates an attribute initialized with the given name and int value.XMLAttribute
(String aName, Boolean aValue) Creates an attribute initialized with the given name and Boolean value.XMLAttribute
(String aName, String aValue) Creates an attribute initialized with the given name and value. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone of this attribute.double
Returns the value for this attribute as a float.float
Returns the value for this attribute as a float.Returns the full name for this attribute.int
Returns the value for this attribute as an int.getName()
Returns the name for this attribute.Returns value for the attribute as a Number (can be any of Integer, Double, etc).Returns the prefix if full name is different.getValue()
Returns the value for this attribute.void
setFullName
(String aName) Sets the full name for this attribute.void
Sets the name for this attribute.void
Sets the value for this attribute.toString()
Returns a basic string representation of this attribute.
-
Constructor Details
-
XMLAttribute
public XMLAttribute()Creates an empty attribute. -
XMLAttribute
Creates an attribute initialized with the given name and value. -
XMLAttribute
Creates an attribute initialized with the given name and boolean value. -
XMLAttribute
Creates an attribute initialized with the given name and Boolean value. -
XMLAttribute
Creates an attribute initialized with the given name and int value. -
XMLAttribute
Creates an attribute initialized with the given name and float value.
-
-
Method Details
-
getName
Returns the name for this attribute. -
setName
Sets the name for this attribute. -
getFullName
Returns the full name for this attribute. -
setFullName
Sets the full name for this attribute. -
getPrefix
Returns the prefix if full name is different. -
getValue
Returns the value for this attribute. -
setValue
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
Returns value for the attribute as a Number (can be any of Integer, Double, etc). -
clone
Returns a clone of this attribute. -
toString
Returns a basic string representation of this attribute.
-