public interface Tag
TagTokenizer
. Allows easy access to element name and attributes.
This interface supports read-only operations on the tag. To change a tag, create a new CustomTag
.Modifier and Type | Interface and Description |
---|---|
static class |
Tag.Type
Type of tag.
|
Modifier and Type | Method and Description |
---|---|
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 (e.g.
|
boolean |
hasAttribute(String name,
boolean caseSensitive)
Determine if an attribute is present.
|
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.
|
void writeTo(Appendable out) throws IOException
IOException
String getName()
int getAttributeCount()
int getAttributeIndex(String name, boolean caseSensitive)
String getAttributeName(int index)
String getAttributeValue(int index)
String getAttributeValue(String name, boolean caseSensitive)
boolean hasAttribute(String name, boolean caseSensitive)
String toString()
This has a slight overhead in that it needs to construct a String. For improved performance, use writeTo() instead.
toString
in class Object
writeTo(Appendable)
Copyright © 2015. All Rights Reserved.