java.lang.Object
org.htmlparser.scanners.TagScanner
org.htmlparser.scanners.CompositeTagScanner
org.htmlparser.scanners.LinkScanner
- All Implemented Interfaces:
- java.io.Serializable
- public class LinkScanner
- extends CompositeTagScanner
Scans for the Link Tag. This is a subclass of TagScanner, and is called using
a variant of the template method. If the evaluate() method returns true, that
means the given string contains an image tag. Extraction is done by the scan
method thereafter by the user of this class.
| Methods inherited from class org.htmlparser.scanners.TagScanner |
absorb, absorbLeadingBlanks, adjustScanners, createScannedNode, createTag, extractXMLData, getFilter, getInsertedEndTag, getReplacedEndTag, insertEndTagBeforeNode, isXMLTagFound, removeChars, replaceFaultyTagWithEndTag, restoreScanners, setFeedback |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MATCH_NAME
private static final java.lang.String[] MATCH_NAME
LINK_SCANNER_ID
public static final java.lang.String LINK_SCANNER_ID
- See Also:
- Constant Field Values
DIRTY_TAG_MESSAGE
public static final java.lang.String DIRTY_TAG_MESSAGE
- See Also:
- Constant Field Values
processor
private org.htmlparser.util.LinkProcessor processor
ENDERS
private static final java.lang.String[] ENDERS
ENDTAG_ENDERS
private static final java.lang.String[] ENDTAG_ENDERS
LinkScanner
public LinkScanner()
- Overriding the default constructor
LinkScanner
public LinkScanner(java.lang.String filter)
- Overriding the constructor to accept the filter
createTag
public org.htmlparser.tags.Tag createTag(org.htmlparser.tags.data.TagData tagData,
org.htmlparser.tags.data.CompositeTagData compositeTagData)
throws org.htmlparser.util.ParserException
- Description copied from class:
CompositeTagScanner
- You must override this method to create the tag of your choice upon
successful parsing. Data required for construction of your tag can be
found within tagData and compositeTagData
- Specified by:
createTag in class CompositeTagScanner
evaluate
public boolean evaluate(java.lang.String s,
TagScanner previousOpenScanner)
- Template Method, used to decide if this scanner can handle the Link tag
type. If the evaluation returns true, the calling side makes a call to
scan().
- Overrides:
evaluate in class TagScanner
extractLink
public java.lang.String extractLink(org.htmlparser.tags.Tag tag,
java.lang.String url)
throws org.htmlparser.util.ParserException
- Extract the link from the given string. The URL of the actual html page
is also provided.
getAccessKey
private java.lang.String getAccessKey(org.htmlparser.tags.Tag tag)
- Extract the access key from the given tag.
createBaseHREFScanner
public BaseHrefScanner createBaseHREFScanner(java.lang.String filter)
createImageScanner
public ImageScanner createImageScanner(java.lang.String filter)
getID
public java.lang.String[] getID()
- Specified by:
getID in class TagScanner