Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.htmlparser.scanners
Class FormScanner  view FormScanner download FormScanner.java

java.lang.Object
  extended byorg.htmlparser.scanners.TagScanner
      extended byorg.htmlparser.scanners.CompositeTagScanner
          extended byorg.htmlparser.scanners.FormScanner
All Implemented Interfaces:
java.io.Serializable

public class FormScanner
extends CompositeTagScanner

Scans for the Image 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.


Field Summary
private static java.lang.String[] formTagEnders
           
private  boolean linkScannerAlreadyOpen
           
private static java.lang.String[] MATCH_ID
           
static java.lang.String PREVIOUS_DIRTY_LINK_MESSAGE
           
 
Fields inherited from class org.htmlparser.scanners.CompositeTagScanner
nameOfTagToMatch
 
Fields inherited from class org.htmlparser.scanners.TagScanner
feedback, filter
 
Constructor Summary
FormScanner(org.htmlparser.Parser parser)
          HTMLFormScanner constructor comment.
FormScanner(java.lang.String filter, org.htmlparser.Parser parser)
          Overriding the constructor to accept the filter
 
Method Summary
 org.htmlparser.tags.Tag createTag(org.htmlparser.tags.data.TagData tagData, org.htmlparser.tags.data.CompositeTagData compositeTagData)
          You must override this method to create the tag of your choice upon successful parsing.
 boolean evaluate(java.lang.String s, TagScanner previousOpenScanner)
          This method is used to decide if this scanner can handle this tag type.
 java.lang.String extractFormLocn(org.htmlparser.tags.Tag tag, java.lang.String url)
          Extract the location of the image, given the string to be parsed, and the url of the html page in which this tag exists.
 java.lang.String extractFormMethod(org.htmlparser.tags.Tag tag)
           
 java.lang.String extractFormName(org.htmlparser.tags.Tag tag)
           
 java.lang.String[] getID()
           
 
Methods inherited from class org.htmlparser.scanners.CompositeTagScanner
beforeScanningStarts, childNodeEncountered, isAllowSelfChildren, isTagToBeEndedFor, scan, shouldCreateEndTagAndExit
 
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
 

Field Detail

MATCH_ID

private static final java.lang.String[] MATCH_ID

PREVIOUS_DIRTY_LINK_MESSAGE

public static final java.lang.String PREVIOUS_DIRTY_LINK_MESSAGE
See Also:
Constant Field Values

linkScannerAlreadyOpen

private boolean linkScannerAlreadyOpen

formTagEnders

private static final java.lang.String[] formTagEnders
Constructor Detail

FormScanner

public FormScanner(org.htmlparser.Parser parser)
HTMLFormScanner constructor comment.


FormScanner

public FormScanner(java.lang.String filter,
                   org.htmlparser.Parser parser)
Overriding the constructor to accept the filter

Method Detail

extractFormLocn

public java.lang.String extractFormLocn(org.htmlparser.tags.Tag tag,
                                        java.lang.String url)
                                 throws org.htmlparser.util.ParserException
Extract the location of the image, given the string to be parsed, and the url of the html page in which this tag exists.


extractFormName

public java.lang.String extractFormName(org.htmlparser.tags.Tag tag)

extractFormMethod

public java.lang.String extractFormMethod(org.htmlparser.tags.Tag tag)

getID

public java.lang.String[] getID()
Specified by:
getID in class TagScanner

evaluate

public boolean evaluate(java.lang.String s,
                        TagScanner previousOpenScanner)
Description copied from class: TagScanner
This method is used to decide if this scanner can handle this tag type. If the evaluation returns true, the calling side makes a call to scan(). This method has to be implemented meaningfully only if a first-word match with the scanner id does not imply a match (or extra processing needs to be done). Default returns true

Overrides:
evaluate in class TagScanner

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