|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.informatica.html.tag.Attributes
public class Attributes
Tag attributes.
When accessing individual attributes, the attribute parser can be fooled if
we search for an attribute name (call it 'attrname'), and this name happens
to coincide with a value in this form: name=" attrname ",
i.e. with white spaces contiguous to double quotes. This is very unlikely to
happen in practice.
Furthermore, this cannot happen when accessing all tags with
getAttributeMap.
| Method Summary | |
|---|---|
void |
append(String text)
|
void |
appendAttribute(String attrname,
String attrvalue)
|
boolean |
containsAttribute(String attrname)
Determines wheteher a given attribute is set or not. |
static Attributes |
create(HTMLTag tag)
|
static Attributes |
create(HTMLTag tag,
String attributes)
|
String |
getAttribute(String attrname)
Gets the value of an attribute. |
Map<String,String> |
getAttributeMap()
Gets a Map of all the attributes. |
int |
length()
|
String |
removeAttribute(String attrname)
Removes an attribute. |
void |
setAttribute(String attrname,
String attrvalue)
Set attribute value |
void |
setAttributes(String attributes)
Set the attribute string. |
void |
setDummyAttribute(String attrname)
Set a dummy attribute. |
String |
toString()
Returns a String with the attributes, including a leading space. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void setAttributes(String attributes)
attributes - the String containing the attributes.public static Attributes create(HTMLTag tag)
public static Attributes create(HTMLTag tag,
String attributes)
public String getAttribute(String attrname)
throws TagParsingException
attrname - lowercase name of the attribute
TagParsingException
public String removeAttribute(String attrname)
throws TagParsingException
attrname - lowercase name of the attribute to be removed
TagParsingExceptionpublic boolean containsAttribute(String attrname)
For example, containsAttribute("disabled") would return true for the tag <sometag name="mytag" disabled="false">.
public void setAttribute(String attrname,
String attrvalue)
throws TagParsingException
TagParsingException
public void setDummyAttribute(String attrname)
throws TagParsingException
This method should be avoided, as dummy attributes are obsolete and not accepted in XHTML.
TagParsingExceptionpublic void append(String text)
public void appendAttribute(String attrname,
String attrvalue)
public int length()
public String toString()
toString in class Object
public Map<String,String> getAttributeMap()
throws TagParsingException
TagParsingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||