public class CustomTag extends Object implements Tag
Tag| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public CustomTag(Tag tag)
public void writeTo(Appendable out) throws IOException
TagwriteTo in interface TagIOExceptionpublic 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()
TaggetAttributeCount in interface Tagpublic int getAttributeIndex(String name, boolean caseSensitive)
TaggetAttributeIndex in interface Tagpublic String getAttributeName(int index)
TaggetAttributeName in interface Tagpublic String getAttributeValue(int index)
TaggetAttributeValue in interface Tagpublic String getAttributeValue(String name, boolean caseSensitive)
TaggetAttributeValue in interface Tagpublic boolean hasAttribute(String name, boolean caseSensitive)
TaghasAttribute in interface Tagpublic String getName()
Tagpublic Tag.Type getType()
public 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.Copyright © 2015. All Rights Reserved.