|
HTML Parser Home Page | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.htmlparser.AbstractNode
org.htmlparser.lexer.nodes.TagNode
org.htmlparser.tags.Tag
org.htmlparser.tags.CompositeTag
org.htmlparser.tags.LinkTag
Identifies a link tag.
| Field Summary | |
protected String |
mLink
The URL where the link points to |
| Fields inherited from class org.htmlparser.tags.CompositeTag |
mDefaultScanner, mEndTag |
| Fields inherited from class org.htmlparser.lexer.nodes.TagNode |
breakTags, mAttributes |
| Fields inherited from class org.htmlparser.AbstractNode |
children, mPage, nodeBegin, nodeEnd, parent |
| Constructor Summary | |
LinkTag()
Constructor creates an LinkTag object, which basically stores the location where the link points to, and the text it contains. |
|
| Method Summary | |
void |
accept(NodeVisitor visitor)
Link visiting code. |
String |
extractLink()
Extract the link from the HREF attribute. |
String |
getAccessKey()
Returns the accesskey attribute value, if any. |
String[] |
getEnders()
Return the set of tag names that cause this tag to finish. |
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 |
getLink()
Returns the url as a string, to which this link points. |
String |
getLinkText()
Returns the text contained inside this link tag |
boolean |
isFTPLink()
Tests if the link is an FTP link. |
boolean |
isHTTPLikeLink()
Tests if the link is an HTTP link or one of its variations (HTTPS, etc.). |
boolean |
isHTTPLink()
Tests if the link is an HTTP link. |
boolean |
isHTTPSLink()
Tests if the link is an HTTPS link. |
boolean |
isIRCLink()
Tests if the link is an IRC link. |
boolean |
isJavascriptLink()
Tests if the link is javascript |
boolean |
isMailLink()
Is this a mail address |
SimpleNodeIterator |
linkData()
Deprecated. Use children() instead. |
void |
setJavascriptLink(boolean newJavascriptLink)
Set the link as a javascript link. |
void |
setLink(String link)
|
void |
setMailLink(boolean newMailLink)
Insert the method's description here. |
String |
toString()
Print the contents of this Link Node |
| Methods inherited from class org.htmlparser.tags.CompositeTag |
childAt, children, collectInto, digupStringNode, elements, findPositionOf, findPositionOf, findPositionOf, getChild, getChildCount, getChildrenAsNodeArray, getChildrenHTML, getEndTag, getStartTag, getStringText, getText, putChildrenInto, putEndTagInto, removeChild, searchByName, searchFor, searchFor, searchFor, searchFor, setEndTag, setStartTag, toHtml, toPlainTextString, toString |
| Methods inherited from class org.htmlparser.tags.Tag |
accept, clone, getThisScanner, setThisScanner |
| Methods inherited from class org.htmlparser.lexer.nodes.TagNode |
breaksFlow, getAttribute, getAttributeEx, getAttributes, getAttributesEx, getEndingLineNumber, getParameter, getParsed, getRawTagName, getStartingLineNumber, getTagBegin, getTagEnd, getTagName, isEmptyXmlTag, isEndTag, removeAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributesEx, setEmptyXmlTag, setTagBegin, setTagEnd, setTagName, setText |
| Methods inherited from class org.htmlparser.AbstractNode |
doSemanticAction, elementBegin, elementEnd, getChildren, getEndPosition, getPage, getParent, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHTML |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected String mLink
| Constructor Detail |
public LinkTag()
In order to get the contents of the link tag, use the method linkData(), which returns an enumeration of nodes encapsulated within the link.
The following code will get all the images inside a link tag.
Node node ;
ImageTag imageTag;
for (Enumeration e=linkTag.linkData();e.hasMoreElements();) {
node = (Node)e.nextElement();
if (node instanceof ImageTag) {
imageTag = (ImageTag)node;
// Process imageTag
}
}
| Method Detail |
public String[] getIds()
getIds in class Tagpublic String[] getEnders()
getEnders in class Tagpublic String[] getEndTagEnders()
getEndTagEnders in class Tagpublic String getAccessKey()
public String getLink()
true) but not
for other protocols. Don't ask me why, it's a legacy thing.
public String getLinkText()
public boolean isMailLink()
public boolean isJavascriptLink()
public boolean isFTPLink()
public boolean isIRCLink()
public boolean isHTTPLink()
public boolean isHTTPSLink()
public boolean isHTTPLikeLink()
public void setMailLink(boolean newMailLink)
newMailLink - booleanpublic void setJavascriptLink(boolean newJavascriptLink)
newJavascriptLink - flag indicating if the link is a javascript codepublic String toString()
toString in interface NodetoString in class CompositeTagpublic void setLink(String link)
public SimpleNodeIterator linkData()
public void accept(NodeVisitor visitor)
visitLinkTag() on the visitor and then
invokes the normal tag processing.
accept in class CompositeTagvisitor - The NodeVisitor object to invoke
visitLinkTag() on.public String extractLink()
|
© 2004 Somik Raha Mar 14, 2004
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||