public interface Tag
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.CharSequence name,
java.lang.CharSequence value)
Adds new attribute without checking if it already exist
thus allowing duplicate attributes.
|
int |
getAttributeCount()
Returns number of tag attributes.
|
int |
getAttributeIndex(java.lang.CharSequence name)
Returns attribute index or
-1 if not found. |
java.lang.CharSequence |
getAttributeName(int index)
Returns attribute name.
|
java.lang.CharSequence |
getAttributeValue(java.lang.CharSequence name)
Returns attribute value or
null for an empty attribute,
Returns null also if attribute name does not exist. |
java.lang.CharSequence |
getAttributeValue(int index)
Returns attribute value or
null for an empty attribute, |
int |
getDeepLevel()
Returns 1-based deep level of a tag from the root.
|
java.lang.CharSequence |
getId()
Returns id attribute value of a tag.
|
java.lang.CharSequence |
getName()
Returns tags name.
|
java.lang.String |
getPosition()
Returns tag position string or
null if position is not calculated. |
int |
getTagLength()
Returns tag length in the input source.
|
int |
getTagPosition()
Returns tag position in the input source.
|
TagType |
getType()
Returns
type of tag (e.g. open, close, etc). |
boolean |
hasAttribute(java.lang.CharSequence name)
Detects if an attribute is present.
|
boolean |
isCaseSensitive()
Returns case-sensitive flag for various name matching.
|
boolean |
isModified()
Returns
true if tag is modified. |
boolean |
isRawTag()
Returns
true if tag should parse inner text content as RAWTEXT. |
boolean |
nameEquals(java.lang.CharSequence charSequence)
Returns
true if name equals to given char sequence. |
void |
removeAttribute(java.lang.CharSequence name)
Removes attribute by given name.
|
void |
removeAttribute(int index)
Removes attribute at given index.
|
void |
removeAttributes()
Removes all attributes.
|
void |
setAttribute(java.lang.CharSequence name,
java.lang.CharSequence value)
Sets new attribute value.
|
void |
setAttributeName(int index,
java.lang.CharSequence name)
Changes attribute name on specific index.
|
void |
setAttributeValue(java.lang.CharSequence name,
java.lang.CharSequence value)
Sets value for attribute with given name.
|
void |
setAttributeValue(int index,
java.lang.CharSequence value)
Sets value for attribute at specific index.
|
void |
setName(java.lang.CharSequence tagName)
Sets tag name.
|
void |
setType(TagType type)
Sets
tag type . |
java.lang.String |
toString()
Get the complete tag as a string.
|
void |
writeTo(java.lang.Appendable out)
Writes the tag to the output.
|
boolean isCaseSensitive()
boolean isRawTag()
true
if tag should parse inner text content as RAWTEXT.java.lang.CharSequence getName()
TagType getType()
type of tag
(e.g. open, close, etc).java.lang.CharSequence getId()
getAttributeValue(java.lang.CharSequence)
or to cache this value for better performances.int getDeepLevel()
int getAttributeCount()
java.lang.CharSequence getAttributeName(int index)
java.lang.CharSequence getAttributeValue(int index)
null
for an empty attribute,java.lang.CharSequence getAttributeValue(java.lang.CharSequence name)
null
for an empty attribute,
Returns null
also if attribute name does not exist.int getAttributeIndex(java.lang.CharSequence name)
-1
if not found.boolean hasAttribute(java.lang.CharSequence name)
int getTagPosition()
int getTagLength()
java.lang.String getPosition()
null
if position is not calculated.void setName(java.lang.CharSequence tagName)
void addAttribute(java.lang.CharSequence name, java.lang.CharSequence value)
void setAttribute(java.lang.CharSequence name, java.lang.CharSequence value)
void setAttributeValue(int index, java.lang.CharSequence value)
void setAttributeValue(java.lang.CharSequence name, java.lang.CharSequence value)
void setAttributeName(int index, java.lang.CharSequence name)
void removeAttribute(int index)
void removeAttribute(java.lang.CharSequence name)
void removeAttributes()
boolean isModified()
true
if tag is modified.boolean nameEquals(java.lang.CharSequence charSequence)
true
if name equals to given char sequence.void writeTo(java.lang.Appendable out)
java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2003-present Jodd Team