|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sitemesh.tagprocessor.CustomTag
public class CustomTag
A CustomTag provides a mechanism to manipulate the contents of a Tag. The standard Tag implementations are immutable, however CustomTag allows a copy to be taken of an immutable Tag that can then be manipulated.
Tag| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.sitemesh.tagprocessor.Tag |
|---|
Tag.Type |
| Constructor Summary | |
|---|---|
CustomTag(String name,
Tag.Type type)
Create new tag. |
|
CustomTag(Tag tag)
Create a CustomTag based on an existing Tag - this takes a copy of the Tag. |
|
| Method Summary | |
|---|---|
int |
addAttribute(String name,
String value)
Add a new attribute. |
boolean |
equals(Object o)
|
int |
getAttributeCount()
Number of attributes in tag. |
int |
getAttributeIndex(String name,
boolean caseSensitive)
Determine which attribute has the specified name. |
String |
getAttributeName(int index)
Get name of attribute. |
String |
getAttributeValue(int index)
Get value of an attribute. |
String |
getAttributeValue(String name,
boolean caseSensitive)
Get value of an attribute. |
String |
getName()
Name of tag (ie. |
Tag.Type |
getType()
Type of tag. |
boolean |
hasAttribute(String name,
boolean caseSensitive)
Determine if an attribute is present. |
int |
hashCode()
|
void |
removeAttribute(int attributeIndex)
Remove an attribute. |
void |
removeAttribute(String name,
boolean caseSensitive)
Change the value of an attribute, or add an attribute if it does not already exist. |
void |
setAttributeName(int attributeIndex,
String name)
Change the name of an existing attribute. |
void |
setAttributeValue(int attributeIndex,
String value)
Change the value of an existing attribute. |
void |
setAttributeValue(String name,
boolean caseSensitive,
String value)
Change the value of an attribute, or add an attribute if it does not already exist. |
void |
setName(String name)
Change the name of the attribute. |
void |
setType(Tag.Type type)
Change the type of the tag. |
String |
toString()
Get the complete tag in its original form, preserving original formatting. |
void |
writeTo(Appendable out)
Write out the complete tag in its original form, preserving original formatting. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CustomTag(String name,
Tag.Type type)
public CustomTag(Tag tag)
| Method Detail |
|---|
public void writeTo(Appendable out)
throws IOException
Tag
writeTo in interface TagIOExceptionpublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
TagThis has a slight overhead in that it needs to construct a String. For improved performance, use writeTo() instead.
toString in interface TagtoString in class ObjectTag.writeTo(Appendable)public int getAttributeCount()
Tag
getAttributeCount in interface Tag
public int getAttributeIndex(String name,
boolean caseSensitive)
Tag
getAttributeIndex in interface Tagpublic String getAttributeName(int index)
Tag
getAttributeName in interface Tagpublic String getAttributeValue(int index)
Tag
getAttributeValue in interface Tag
public String getAttributeValue(String name,
boolean caseSensitive)
Tag
getAttributeValue in interface Tag
public boolean hasAttribute(String name,
boolean caseSensitive)
Tag
hasAttribute in interface Tagpublic String getName()
Tag
getName in interface Tagpublic Tag.Type getType()
getType in interface TagTag.Typepublic void setName(String name)
public void setType(Tag.Type type)
public int addAttribute(String name,
String value)
name - Name of attribute to change.value - New value of attribute or null for an HTML style empty attribute.
public void setAttributeValue(String name,
boolean caseSensitive,
String value)
name - Name of attribute to change.caseSensitive - Whether the name should be treated as case sensitive when searching for an existing value.value - New value of attribute or null for an HTML style empty attribute.
public void setAttributeName(int attributeIndex,
String name)
public void setAttributeValue(int attributeIndex,
String value)
public void removeAttribute(int attributeIndex)
public void removeAttribute(String name,
boolean caseSensitive)
name - Name of attribute to remove.caseSensitive - Whether the name should be treated as case sensitive.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||