|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface represents a tag (<xxx yyy="zzz">) in the HTML document. Adds capabilities to a Node that are specific to a tag.
| Method Summary | |
boolean |
breaksFlow()
Determines if the given tag breaks the flow of text. |
java.lang.String |
getAttribute(java.lang.String name)
Returns the value of an attribute. |
Attribute |
getAttributeEx(java.lang.String name)
Returns the attribute with the given name. |
java.util.Hashtable |
getAttributes()
Deprecated. Use getAttributesEx() instead. |
java.util.Vector |
getAttributesEx()
Gets the attributes in the tag. |
java.lang.String[] |
getEnders()
Return the set of tag names that cause this tag to finish. |
int |
getEndingLineNumber()
Get the line number where this tag ends. |
Tag |
getEndTag()
Get the end tag for this (composite) tag. |
java.lang.String[] |
getEndTagEnders()
Return the set of end tag names that cause this tag to finish. |
java.lang.String[] |
getIds()
Return the set of names handled by this tag. |
java.lang.String |
getRawTagName()
Return the name of this tag. |
int |
getStartingLineNumber()
Get the line number where this tag starts. |
java.lang.String |
getTagName()
Return the name of this tag. |
Scanner |
getThisScanner()
Return the scanner associated with this tag. |
boolean |
isEmptyXmlTag()
Is this an empty xml tag of the form <tag/>. |
boolean |
isEndTag()
Predicate to determine if this tag is an end tag (i.e. |
void |
removeAttribute(java.lang.String key)
Remove the attribute with the given key, if it exists. |
void |
setAttribute(java.lang.String key,
java.lang.String value)
Set attribute with given key, value pair. |
void |
setAttribute(java.lang.String key,
java.lang.String value,
char quote)
Set attribute with given key/value pair, the value is quoted by quote. |
void |
setAttributeEx(Attribute attribute)
Set an attribute. |
void |
setAttributes(java.util.Hashtable attributes)
Deprecated. Use setAttributesEx() instead. |
void |
setAttributesEx(java.util.Vector attribs)
Sets the attributes. |
void |
setEmptyXmlTag(boolean emptyXmlTag)
Set this tag to be an empty xml node, or not. |
void |
setEndTag(Tag tag)
Set the end tag for this (composite) tag. |
void |
setTagName(java.lang.String name)
Set the name of this tag. |
void |
setThisScanner(Scanner scanner)
Set the scanner associated with this tag. |
| Methods inherited from interface org.htmlparser.Node |
accept, clone, collectInto, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, getText, setChildren, setEndPosition, setPage, setParent, setStartPosition, setText, toHtml, toPlainTextString, toString |
| Method Detail |
public java.lang.String getAttribute(java.lang.String name)
name - Name of attribute, case insensitive.
setAttribute(java.lang.String, java.lang.String)
public void setAttribute(java.lang.String key,
java.lang.String value)
key - The name of the attribute.value - The value of the attribute.getAttribute(java.lang.String),
setAttribute(String,String,char)
public void setAttribute(java.lang.String key,
java.lang.String value,
char quote)
key - The name of the attribute.value - The value of the attribute.quote - The quote character to be used around value.
If zero, it is an unquoted value.getAttribute(java.lang.String)public void removeAttribute(java.lang.String key)
key - The name of the attribute.public Attribute getAttributeEx(java.lang.String name)
name - Name of attribute, case insensitive.
setAttributeEx(org.htmlparser.Attribute)public void setAttributeEx(Attribute attribute)
attribute - The attribute to set.getAttributeEx(java.lang.String)public java.util.Vector getAttributesEx()
Attributes in the tag.setAttributesEx(java.util.Vector)public void setAttributesEx(java.util.Vector attribs)
attribs - The attribute collection to set.getAttributesEx()public java.util.Hashtable getAttributes()
getAttributesEx which returns a list of Attribute objects, which offer more information than the simple
String objects available from this Hashtable.
null if there was no value
for an attribute (either no equals sign or nothing to the right of the
equals sign). A special entry with a key of
SpecialHashtable.TAGNAME ("$<TAGNAME>$") holds the tag name.
The conversion to uppercase is performed with an ENGLISH locale.setAttributes(java.util.Hashtable)public void setAttributes(java.util.Hashtable attributes)
attributes - The attribute collection to set.getAttributes()public java.lang.String getTagName()
Note: This value is converted to uppercase and does not begin with "/" if it is an end tag. Nor does it end with a slash in the case of an XML type tag. The conversion to uppercase is performed with an ENGLISH locale.
setTagName(java.lang.String)public void setTagName(java.lang.String name)
name - The tag name.getTagName()public java.lang.String getRawTagName()
public boolean breaksFlow()
true if following text would start on a new line,
false otherwise.public boolean isEndTag()
true if this tag is an end tag.public boolean isEmptyXmlTag()
public void setEmptyXmlTag(boolean emptyXmlTag)
emptyXmlTag - If true, ensures there is an ending slash in the node,
i.e. <tag/>, otherwise removes it.public java.lang.String[] getIds()
public java.lang.String[] getEnders()
public java.lang.String[] getEndTagEnders()
public Tag getEndTag()
null.
setEndTag(org.htmlparser.Tag)public void setEndTag(Tag tag)
tag - The tag that closes this composite tag, i.e. </HTML>.getEndTag()public Scanner getThisScanner()
setThisScanner(org.htmlparser.scanners.Scanner)public void setThisScanner(Scanner scanner)
scanner - The scanner for this tag.getThisScanner()public int getStartingLineNumber()
public int getEndingLineNumber()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||