|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.html.HtmlAttribute
public class HtmlAttribute
An attribute (see HTML.Attribute
)
of an HTML element.
Version Info:
$Revision: 545 $ |
$Date: 2007-04-19 10:38:45 -0600 (Thu, 19 Apr 2007) $ |
$Author: dharland $ |
Constructor Summary | |
---|---|
HtmlAttribute(HTML.Attribute attrType)
Creates a new HTML attribute of the given type and with a value of the empty string (""). |
|
HtmlAttribute(HTML.Attribute attrType,
String attrValue)
Creates a new HTML attribute of the given type and value. |
|
HtmlAttribute(String attrName,
String attrValue)
Creates a new HTML attribute of the given type and value. |
Method Summary | |
---|---|
boolean |
equals(Object o)
Returns true if o is equal to this attribute. |
HTML.Attribute |
getType()
Returns the type of this attribute. |
String |
getValue()
Returns the value of this attribute. |
int |
hashCode()
|
static HtmlAttribute |
parse(String nameValueText)
Creates and returns a new HTML attribute by parsing nameValueText . |
void |
setValue(String newValue)
Sets the value of this attribute. |
String |
toString()
Returns a string of the form name="value". |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HtmlAttribute(String attrName, String attrValue)
attrName
- the name, or type, of this attribute.
This value must be a valid attribute name.
Validity is determined by
HTML.getAttributeKey(String)
.
A list of known attribute names may be found in
HTML.Attribute
.attrValue
- the value of this attribute.
See setValue(String)
for the rules about this
parameter.public HtmlAttribute(HTML.Attribute attrType, String attrValue)
attrType
- the type of this attribute. If this parameter is
null an IllegalArgumentException
will be thrown.attrValue
- the value of this attribute.
See setValue(String)
for the rules about this
parameter.public HtmlAttribute(HTML.Attribute attrType)
attrType
- the type of this attribute. If this parameter is
null an IllegalArgumentException
will be thrown.Method Detail |
---|
public HTML.Attribute getType()
public final void setValue(String newValue)
newValue
- a new value for this attribute. If this parameter is
null, it will be replaced by the empty
string (""). This parameter may contain
single quote (') or double quote
(") characters, but not both. If it does,
an IllegalArgumentException
will be thrown
and this attribute's value will be left in its
present state.public String getValue()
public static HtmlAttribute parse(String nameValueText)
nameValueText
.
nameValueText
- the HTML form of this attribute.
The expected form of the text is:
name="value"Values may be quoted with either single (') or double (") quotes. Leading and trailing whitespace is permitted and will be trimmed during parsing. The name must be a valid attribute name. Validity is determined by
HTML.getAttributeKey(String)
. A list of known attribute names
may be found in HTML.Attribute
.
nameValueText
.
IllegalArgumentException
- if anything goes wrong during parsing.public String toString()
toString
in class Object
public boolean equals(Object o)
o
is equal to this attribute.
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |