public interface Tag
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(java.lang.String name,
java.lang.String value)
Adds new attribute without checking if it already exist
thus allowing duplicate attributes.
|
LagartoLexer.Position |
calculateTagPosition()
Calculates current position of a tag .
|
int |
getAttributeCount()
Returns number of tag attributes.
|
int |
getAttributeIndex(java.lang.String name,
boolean caseSensitive)
Returns attribute index or
-1 if not found. |
java.lang.String |
getAttributeName(int index)
Returns attribute name.
|
java.lang.String |
getAttributeValue(int index)
Returns attribute value or
null for an empty attribute, |
java.lang.String |
getAttributeValue(java.lang.String name,
boolean caseSensitive)
Returns attribute value or
null for an empty attribute,
Returns null also if attribute name does not exist. |
int |
getDeepLevel()
Returns 1-based deep level of a tag from the root.
|
java.lang.String |
getId()
Returns id attribute value of a tag.
|
java.lang.String |
getName()
Returns tags name.
|
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.String name,
boolean caseSensitive)
Detects if an attribute is present.
|
boolean |
isModified()
Returns
true if tag is modified. |
void |
removeAttribute(int index)
Removes attribute.
|
void |
removeAttribute(java.lang.String name,
boolean caseSensitive)
Removes attribute.
|
void |
removeAttributes()
Removes all attributes.
|
void |
setAttribute(java.lang.String name,
boolean caseSensitive,
java.lang.String value)
Sets new attribute value.
|
void |
setAttributeName(int index,
java.lang.String name)
Changes attribute name on specific index.
|
void |
setAttributeValue(int index,
java.lang.String value)
Sets value for attribute at specific index.
|
void |
setAttributeValue(java.lang.String name,
boolean caseSensitive,
java.lang.String value)
Sets value for attribute at specific index.
|
void |
setModified()
Force
isModified() to be true. |
void |
setName(java.lang.String tagName)
Sets new tag name.
|
void |
setType(TagType type)
Sets new tag type.
|
java.lang.String |
toString()
Get the complete tag.
|
void |
writeTo(java.lang.Appendable out)
Shortcut for
writeTo(out, false). |
void |
writeTo(java.lang.Appendable out,
boolean forceBuild)
Write out the complete tag.
|
java.lang.String getName()
TagType getType()
type of tag (e.g. open, close, etc).java.lang.String getId()
getAttributeValue(String, boolean)
or to cache this value for better performances.int getDeepLevel()
int getAttributeCount()
java.lang.String getAttributeName(int index)
java.lang.String getAttributeValue(int index)
null for an empty attribute,java.lang.String getAttributeValue(java.lang.String name,
boolean caseSensitive)
null for an empty attribute,
Returns null also if attribute name does not exist.int getAttributeIndex(java.lang.String name,
boolean caseSensitive)
-1 if not found.boolean hasAttribute(java.lang.String name,
boolean caseSensitive)
int getTagPosition()
LagartoLexer.Position calculateTagPosition()
int getTagLength()
void setName(java.lang.String tagName)
void setType(TagType type)
void addAttribute(java.lang.String name,
java.lang.String value)
void setAttribute(java.lang.String name,
boolean caseSensitive,
java.lang.String value)
void setAttributeValue(int index,
java.lang.String value)
void setAttributeValue(java.lang.String name,
boolean caseSensitive,
java.lang.String value)
void setAttributeName(int index,
java.lang.String name)
void removeAttribute(int index)
void removeAttribute(java.lang.String name,
boolean caseSensitive)
void removeAttributes()
boolean isModified()
true if tag is modified.void setModified()
isModified() to be true.
Used when tags needs to be regenerated.void writeTo(java.lang.Appendable out)
throws java.io.IOException
writeTo(out, false).java.io.IOExceptionvoid writeTo(java.lang.Appendable out,
boolean forceBuild)
throws java.io.IOException
java.io.IOExceptionjava.lang.String toString()
toString in class java.lang.ObjectCopyright © 2003-2013 Jodd Team