public class Tag
extends java.lang.Object
implements java.lang.Cloneable
| Modifier and Type | Class and Description |
|---|---|
static class |
Tag.Type
Tag types.
|
| Constructor and Description |
|---|
Tag() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the name, type and attributes.
|
Tag |
clone() |
int |
getAttributeInt(java.lang.String attributeId)
Get the specified attribute as an integer.
|
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Get a map of all attributes.
|
java.lang.String |
getAttributeValue(java.lang.String name)
Get the value of the specified attribute.
|
java.lang.String |
getName() |
Tag.Type |
getType() |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Set a HTML attribute.
|
void |
setName(java.lang.String s)
Set the tag name.
|
void |
setType(Tag.Type type)
Set the tag type.
|
java.lang.String |
toString()
Convert this tag back into string form, with the beginning < and ending
>.
|
public void clear()
public Tag clone()
clone in class java.lang.Objectpublic int getAttributeInt(java.lang.String attributeId)
attributeId - The attribute name.public java.util.Map<java.lang.String,java.lang.String> getAttributes()
public java.lang.String getAttributeValue(java.lang.String name)
name - The name of an attribute.public java.lang.String getName()
public Tag.Type getType()
public void setAttribute(java.lang.String name,
java.lang.String value)
name - The name of the attribute.value - The value of the attribute.public void setName(java.lang.String s)
s - The name.public void setType(Tag.Type type)
type - The tag type.public java.lang.String toString()
toString in class java.lang.Object