Package jodd.lagarto
Interface Tag
-
public interface TagTag definition.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAttribute(java.lang.CharSequence name, java.lang.CharSequence value)Adds new attribute without checking if it already exist thus allowing duplicate attributes.intgetAttributeCount()Returns number of tag attributes.intgetAttributeIndex(java.lang.CharSequence name)Returns attribute index or-1if not found.java.lang.CharSequencegetAttributeName(int index)Returns attribute name.java.lang.CharSequencegetAttributeValue(int index)Returns attribute value ornullfor an empty attribute,java.lang.CharSequencegetAttributeValue(java.lang.CharSequence name)Returns attribute value ornullfor an empty attribute, Returnsnullalso if attribute name does not exist.intgetDeepLevel()Returns 1-based deep level of a tag from the root.java.lang.CharSequencegetId()Returns id attribute value of a tag.java.lang.CharSequencegetName()Returns tags name.java.lang.StringgetPosition()Returns tag position string ornullif position is not calculated.intgetTagLength()Returns tag length in the input source.intgetTagPosition()Returns tag position in the input source.TagTypegetType()Returnstype of tag(e.g.booleanhasAttribute(java.lang.CharSequence name)Detects if an attribute is present.booleanisCaseSensitive()Returns case-sensitive flag for various name matching.booleanisModified()Returnstrueif tag is modified.booleanisRawTag()Returnstrueif tag should parse inner text content as RAWTEXT.booleannameEquals(java.lang.CharSequence charSequence)Returnstrueif name equals to given char sequence.voidremoveAttribute(int index)Removes attribute at given index.voidremoveAttribute(java.lang.CharSequence name)Removes attribute by given name.voidremoveAttributes()Removes all attributes.voidsetAttribute(java.lang.CharSequence name, java.lang.CharSequence value)Sets new attribute value.voidsetAttributeName(int index, java.lang.CharSequence name)Changes attribute name on specific index.voidsetAttributeValue(int index, java.lang.CharSequence value)Sets value for attribute at specific index.voidsetAttributeValue(java.lang.CharSequence name, java.lang.CharSequence value)Sets value for attribute with given name.voidsetName(java.lang.CharSequence tagName)Sets tag name.voidsetType(TagType type)Setstag type.java.lang.StringtoString()Get the complete tag as a string.voidwriteTo(java.lang.Appendable out)Writes the tag to the output.
-
-
-
Method Detail
-
isCaseSensitive
boolean isCaseSensitive()
Returns case-sensitive flag for various name matching.
-
isRawTag
boolean isRawTag()
Returnstrueif tag should parse inner text content as RAWTEXT.
-
getName
java.lang.CharSequence getName()
Returns tags name.
-
getType
TagType getType()
Returnstype of tag(e.g. open, close, etc).
-
getId
java.lang.CharSequence getId()
Returns id attribute value of a tag. Implementations may simply callgetAttributeValue(java.lang.CharSequence)or to cache this value for better performances.
-
getDeepLevel
int getDeepLevel()
Returns 1-based deep level of a tag from the root.
-
getAttributeCount
int getAttributeCount()
Returns number of tag attributes.
-
getAttributeName
java.lang.CharSequence getAttributeName(int index)
Returns attribute name.
-
getAttributeValue
java.lang.CharSequence getAttributeValue(int index)
Returns attribute value ornullfor an empty attribute,
-
getAttributeValue
java.lang.CharSequence getAttributeValue(java.lang.CharSequence name)
Returns attribute value ornullfor an empty attribute, Returnsnullalso if attribute name does not exist.
-
getAttributeIndex
int getAttributeIndex(java.lang.CharSequence name)
Returns attribute index or-1if not found.
-
hasAttribute
boolean hasAttribute(java.lang.CharSequence name)
Detects if an attribute is present.
-
getTagPosition
int getTagPosition()
Returns tag position in the input source.
-
getTagLength
int getTagLength()
Returns tag length in the input source.
-
getPosition
java.lang.String getPosition()
Returns tag position string ornullif position is not calculated.
-
setName
void setName(java.lang.CharSequence tagName)
Sets tag name.
-
addAttribute
void addAttribute(java.lang.CharSequence name, java.lang.CharSequence value)Adds new attribute without checking if it already exist thus allowing duplicate attributes.
-
setAttribute
void setAttribute(java.lang.CharSequence name, java.lang.CharSequence value)Sets new attribute value. If attribute already exist, it's value is changed. If attribute does not exist, it will be added to the tag.
-
setAttributeValue
void setAttributeValue(int index, java.lang.CharSequence value)Sets value for attribute at specific index. Throws exception if index is invalid.
-
setAttributeValue
void setAttributeValue(java.lang.CharSequence name, java.lang.CharSequence value)Sets value for attribute with given name. If attribute with given name doesn't exist, nothing changes.
-
setAttributeName
void setAttributeName(int index, java.lang.CharSequence name)Changes attribute name on specific index. Throws exception if index is invalid.
-
removeAttribute
void removeAttribute(int index)
Removes attribute at given index. Throws exception if index is invalid.
-
removeAttribute
void removeAttribute(java.lang.CharSequence name)
Removes attribute by given name.
-
removeAttributes
void removeAttributes()
Removes all attributes.
-
isModified
boolean isModified()
Returnstrueif tag is modified.
-
nameEquals
boolean nameEquals(java.lang.CharSequence charSequence)
Returnstrueif name equals to given char sequence.
-
writeTo
void writeTo(java.lang.Appendable out)
Writes the tag to the output.
-
toString
java.lang.String toString()
Get the complete tag as a string.- Overrides:
toStringin classjava.lang.Object
-
-