bill.util.xml
Class SimpleXMLAttribute

java.lang.Object
  |
  +--bill.util.xml.SimpleXMLAttribute

public class SimpleXMLAttribute
extends Object

Stores information related to an XML object's attributes. This includes the name of the attribute and its value.


Constructor Summary
SimpleXMLAttribute(SimpleXMLAttribute attr)
          Copy constructor that makes a new instance based on the values of an existing one.
SimpleXMLAttribute(String name, String value)
          Main creator, sets the attribute's name and value to the values passed in and defaults the value surrounder to a double quote.
SimpleXMLAttribute(String name, String value, char surrounder)
          Alternate creator, sets the attribute's name and value to the values passed in.
 
Method Summary
 boolean equals(Object other)
          Checks if two SimpleXMLAttribute objects are equal.
 String getName()
          Retrieves the name of this object.
 char getSurrounder()
          Retrieves the character that acts as the attribute value's surrounder.
 String getValue()
          Retrieves the value of this object.
 void setName(String name)
          Sets the name of this object.
 void setValue(String value)
          Sets the value of this object.
 String toXML()
          Dumps out the object in valid XML string representation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleXMLAttribute

public SimpleXMLAttribute(String name,
                          String value)
Main creator, sets the attribute's name and value to the values passed in and defaults the value surrounder to a double quote.
Parameters:
name - The name of the attribute.
value - The value of the attribute.

SimpleXMLAttribute

public SimpleXMLAttribute(String name,
                          String value,
                          char surrounder)
Alternate creator, sets the attribute's name and value to the values passed in.
Parameters:
name - The name of the attribute.
value - The value of the attribute.
surrounder - The character to surround the attribute value with. Should be either a quote (') or a double quote (").

SimpleXMLAttribute

public SimpleXMLAttribute(SimpleXMLAttribute attr)
Copy constructor that makes a new instance based on the values of an existing one.
Parameters:
attr - The attribute object to make a copy of
Method Detail

getName

public String getName()
Retrieves the name of this object.
Returns:
The name of this object.

setName

public void setName(String name)
Sets the name of this object.
Parameters:
name - The new name of this object.

getValue

public String getValue()
Retrieves the value of this object.
Returns:
The value of this object

setValue

public void setValue(String value)
Sets the value of this object.
Parameters:
value - The new value of this object.

getSurrounder

public char getSurrounder()
Retrieves the character that acts as the attribute value's surrounder.
Returns:
The surrounder character.

toXML

public String toXML()
Dumps out the object in valid XML string representation.
Returns:
The XML in string format.

equals

public boolean equals(Object other)
Checks if two SimpleXMLAttribute objects are equal. They are concidered equal if their names match.
Overrides:
equals in class Object
Parameters:
other - The other object to check for equality.
Returns:
Returns true if the object are equal, returns false otherwise.