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

Quick Search    Search Deep

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

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

public class BulletScanner
extends CompositeTagScanner

This scanner is created by BulletListScanner. It shares a stack to maintain the parent-child relationship with BulletListScanner. The rules implemented are :
[1] A <ul> can have <li> under it
[2] A <li> can have <ul> under it
[3] A <li> cannot have <li> under it

These rules are implemented easily through the shared stack.


Field Summary
private static java.lang.String[] END_TAG_ENDERS
           
private static java.lang.String[] ENDERS
           
private static java.lang.String[] MATCH_STRING
           
private  java.util.Stack ulli
           
 
Fields inherited from class org.htmlparser.scanners.CompositeTagScanner
nameOfTagToMatch
 
Fields inherited from class org.htmlparser.scanners.TagScanner
feedback, filter
 
Constructor Summary
BulletScanner(java.util.Stack ulli)
           
BulletScanner(java.lang.String filter, java.util.Stack ulli)
           
 
Method Summary
 void beforeScanningStarts()
          Override this method if you wish to create any data structures or do anything before the start of the scan.
 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.
 java.lang.String[] getID()
           
 boolean shouldCreateEndTagAndExit()
          This is the logic that decides when a bullet tag can be allowed
 
Methods inherited from class org.htmlparser.scanners.CompositeTagScanner
childNodeEncountered, isAllowSelfChildren, isTagToBeEndedFor, scan
 
Methods inherited from class org.htmlparser.scanners.TagScanner
absorb, absorbLeadingBlanks, adjustScanners, createScannedNode, createTag, evaluate, 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_STRING

private static final java.lang.String[] MATCH_STRING

ENDERS

private static final java.lang.String[] ENDERS

END_TAG_ENDERS

private static final java.lang.String[] END_TAG_ENDERS

ulli

private java.util.Stack ulli
Constructor Detail

BulletScanner

public BulletScanner(java.util.Stack ulli)

BulletScanner

public BulletScanner(java.lang.String filter,
                     java.util.Stack ulli)
Method Detail

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

getID

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

shouldCreateEndTagAndExit

public boolean shouldCreateEndTagAndExit()
This is the logic that decides when a bullet tag can be allowed

Overrides:
shouldCreateEndTagAndExit in class CompositeTagScanner

beforeScanningStarts

public void beforeScanningStarts()
Description copied from class: CompositeTagScanner
Override this method if you wish to create any data structures or do anything before the start of the scan. This is just after a tag has triggered the scanner but before the scanner begins its processing.

Overrides:
beforeScanningStarts in class CompositeTagScanner