public class Attribute extends Object
This class provides a simple container for XML attribute name-value pairs. Attributes can be created independently or copied from existing attributes.
| Constructor and Description |
|---|
Attribute()
Creates an empty Attribute with empty name and value.
|
Attribute(Attribute otherAttr)
Creates a copy of an existing Attribute.
|
Attribute(String name,
String value)
Creates an Attribute with the specified name and value.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Gets the name of this attribute.
|
String |
getValue()
Gets the value of this attribute.
|
void |
set(Attribute otherAttr)
Copies the name and value from another attribute to this attribute.
|
void |
setName(String name)
Sets the name of this attribute.
|
void |
setValue(String value)
Sets the value of this attribute.
|
public Attribute()
public Attribute(Attribute otherAttr)
otherAttr - the attribute to copypublic String getName()
public String getValue()
public void set(Attribute otherAttr)
otherAttr - the attribute to copy frompublic void setName(String name)
name - the attribute namepublic void setValue(String value)
value - the attribute value