info.bliki.wiki.filter
Class WikipediaParser

java.lang.Object
  extended by info.bliki.wiki.filter.WikipediaScanner
      extended by info.bliki.wiki.filter.AbstractParser
          extended by info.bliki.wiki.filter.WikipediaParser
All Implemented Interfaces:
IParser

public class WikipediaParser
extends AbstractParser
implements IParser

A Wikipedia syntax parser for the second pass in the parsing of a Wikipedia source text.

See Also:
for the first pass

Field Summary
 
Fields inherited from class info.bliki.wiki.filter.WikipediaScanner
EOF, TAG_NAME
 
Constructor Summary
WikipediaParser(java.lang.String stringSource, boolean renderTemplate)
           
WikipediaParser(java.lang.String stringSource, boolean renderTemplate, IEventListener wikiListener)
           
 
Method Summary
 boolean isNoToC()
          count the number of wiki headers in this document
 boolean isTemplate()
          The text is rendered as a template
static void parse(java.lang.String rawWikiText, IWikiModel wikiModel, boolean parseTemplates)
          Call the parser on the first recursion level, where the text can contain a table of contents (TOC).
static void parseRecursive(java.lang.String rawWikitext, IWikiModel wikiModel)
          Call the parser on the subsequent recursion levels, where the subtexts (of templates, table cells, list items or image captions) don't contain a table of contents (TOC) Note: the wiki model doesn't call the setUp() or tearDown() methods for the subsequent recursive parser steps.
static TagStack parseRecursive(java.lang.String rawWikitext, IWikiModel wikiModel, boolean createOnlyLocalStack, boolean noTOC)
          Call the parser on the subsequent recursion levels, where the subtexts (of templates, table cells, list items or image captions) don't contain a table of contents (TOC) Note: the wiki model doesn't call the setUp() or tearDown() methods for the subsequent recursive parser steps.
 void setNoToC(boolean noToC)
          Set the no table of contents render mode
 
Methods inherited from class info.bliki.wiki.filter.WikipediaScanner
findNestedEnd, findNestedParamEnd, getPosition, indexEndOfComment, indexEndOfNowiki, indexEndOfTable, indexOf, indexOf, indexOfAttributes, main, nextNewline, replaceTemplateParameters, scanWhiteSpace, setModel, setPosition, splitByPipe, wpList, wpTable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.bliki.wiki.filter.IParser
setModel
 

Constructor Detail

WikipediaParser

public WikipediaParser(java.lang.String stringSource,
                       boolean renderTemplate)

WikipediaParser

public WikipediaParser(java.lang.String stringSource,
                       boolean renderTemplate,
                       IEventListener wikiListener)
Method Detail

isNoToC

public boolean isNoToC()
count the number of wiki headers in this document

Specified by:
isNoToC in interface IParser
Parameters:
toc -
Returns:

setNoToC

public void setNoToC(boolean noToC)
Description copied from interface: IParser
Set the no table of contents render mode

Specified by:
setNoToC in interface IParser

parse

public static void parse(java.lang.String rawWikiText,
                         IWikiModel wikiModel,
                         boolean parseTemplates)
Call the parser on the first recursion level, where the text can contain a table of contents (TOC).

Note: in this level the wiki model will call the setUp() method before parsing and the tearDown() method after the parser has finished.

Parameters:
wikiModel -
parseTemplates -
rawWikitext -

parseRecursive

public static void parseRecursive(java.lang.String rawWikitext,
                                  IWikiModel wikiModel)
Call the parser on the subsequent recursion levels, where the subtexts (of templates, table cells, list items or image captions) don't contain a table of contents (TOC) Note: the wiki model doesn't call the setUp() or tearDown() methods for the subsequent recursive parser steps.

Parameters:
rawWikitext -
wikiModel -

parseRecursive

public static TagStack parseRecursive(java.lang.String rawWikitext,
                                      IWikiModel wikiModel,
                                      boolean createOnlyLocalStack,
                                      boolean noTOC)
Call the parser on the subsequent recursion levels, where the subtexts (of templates, table cells, list items or image captions) don't contain a table of contents (TOC) Note: the wiki model doesn't call the setUp() or tearDown() methods for the subsequent recursive parser steps.

Parameters:
rawWikitext -
wikiModel -
noTOC -
appendStack -
Returns:

isTemplate

public boolean isTemplate()
Description copied from interface: IParser
The text is rendered as a template

Specified by:
isTemplate in interface IParser
Returns: