|
HTML Parser Home Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Tag
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. |
String |
getAttribute(String name)
Returns the value of an attribute. |
Attribute |
getAttributeEx(String name)
Returns the attribute with the given name. |
Vector |
getAttributesEx()
Gets the attributes in the tag. |
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. |
String[] |
getEndTagEnders()
Return the set of end tag names that cause this tag to finish. |
String[] |
getIds()
Return the set of names handled by this tag. |
String |
getRawTagName()
Return the name of this tag. |
int |
getStartingLineNumber()
Get the line number where this tag starts. |
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(String key)
Remove the attribute with the given key, if it exists. |
void |
setAttribute(String key,
String value)
Set attribute with given key, value pair. |
void |
setAttribute(String key,
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 |
setAttributesEx(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(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, toHtml, toPlainTextString, toString |
Method Detail |
---|
String getAttribute(String name)
name
- Name of attribute, case insensitive.
setAttribute(java.lang.String, java.lang.String)
void setAttribute(String key, String value)
key
- The name of the attribute.value
- The value of the attribute.getAttribute(java.lang.String)
,
setAttribute(String,String,char)
void setAttribute(String key, 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)
void removeAttribute(String key)
key
- The name of the attribute.Attribute getAttributeEx(String name)
name
- Name of attribute, case insensitive.
setAttributeEx(org.htmlparser.Attribute)
void setAttributeEx(Attribute attribute)
attribute
- The attribute to set.getAttributeEx(java.lang.String)
Vector getAttributesEx()
Attributes
in the tag.setAttributesEx(java.util.Vector)
void setAttributesEx(Vector attribs)
attribs
- The attribute collection to set.getAttributesEx()
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)
void setTagName(String name)
name
- The tag name.getTagName()
String getRawTagName()
boolean breaksFlow()
true
if following text would start on a new line,
false
otherwise.boolean isEndTag()
true
if this tag is an end tag.boolean isEmptyXmlTag()
void setEmptyXmlTag(boolean emptyXmlTag)
emptyXmlTag
- If true, ensures there is an ending slash in the node,
i.e. <tag/>, otherwise removes it.String[] getIds()
String[] getEnders()
String[] getEndTagEnders()
Tag getEndTag()
null
.
setEndTag(org.htmlparser.Tag)
void setEndTag(Tag tag)
tag
- The tag that closes this composite tag, i.e. </HTML>.getEndTag()
Scanner getThisScanner()
setThisScanner(org.htmlparser.scanners.Scanner)
void setThisScanner(Scanner scanner)
scanner
- The scanner for this tag.getThisScanner()
int getStartingLineNumber()
int getEndingLineNumber()
|
© 2006 Derrick Oswald Sep 17, 2006
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
HTML Parser is an open source library released under Common Public License. |