public class LinkTag extends CompositeTag
| 构造器和说明 |
|---|
LinkTag()
Constructor creates an LinkTag object, which basically stores the location
where the link points to, and the text it contains.
|
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.String |
extractLink()
Extract the link from the HREF attribute.
|
java.lang.String |
getAccessKey()
Get the
ACCESSKEY attribute, if any. |
java.lang.String[] |
getEnders()
Return the set of tag names that cause this tag to finish.
|
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 |
getLink()
Returns the url as a string, to which this link points.
|
java.lang.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
|
void |
setJavascriptLink(boolean newJavascriptLink)
Set the link as a javascript link.
|
void |
setLink(java.lang.String link)
Set the
HREF attribute. |
void |
setMailLink(boolean newMailLink)
Insert the method's description here.
|
java.lang.String |
toString()
Return the contents of this link node as a string suitable for debugging.
|
accept, childAt, children, collectInto, digupStringNode, elements, findPositionOf, findPositionOf, findPositionOf, getChild, getChildCount, getChildrenAsNodeArray, getChildrenHTML, getEndTag, getStringText, getText, removeChild, searchByName, searchFor, searchFor, searchFor, searchFor, setEndTag, toHtml, toPlainTextString, toStringbreaksFlow, getAttribute, getAttributeEx, getAttributesEx, getEndingLineNumber, getRawTagName, getStartingLineNumber, getTagBegin, getTagEnd, getTagName, getThisScanner, isEmptyXmlTag, isEndTag, removeAttribute, setAttribute, setAttribute, setAttribute, setAttributeEx, setAttributesEx, setEmptyXmlTag, setTagBegin, setTagEnd, setTagName, setText, setThisScannerclone, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtmlclone, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtmlpublic LinkTag()
In order to get the contents of the link tag, use the method children(), 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.children();e.hasMoreElements();) {
node = (Node)e.nextElement();
if (node instanceof ImageTag) {
imageTag = (ImageTag)node;
// Process imageTag
}
}
public java.lang.String[] getIds()
public java.lang.String[] getEnders()
public java.lang.String[] getEndTagEnders()
getEndTagEnders 在接口中 TaggetEndTagEnders 在类中 TagNodepublic java.lang.String getAccessKey()
ACCESSKEY attribute, if any.ACCESSKEY attribute,
or null if the attribute doesn't exist.public java.lang.String getLink()
true) but not
for other protocols. Don't ask me why, it's a legacy thing.A tag.public java.lang.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 java.lang.String toString()
toString 在接口中 NodetoString 在类中 CompositeTagpublic void setLink(java.lang.String link)
HREF attribute.link - The new value of the HREF attribute.public java.lang.String extractLink()