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.AbstractParser
fCurrentCharacter, fCurrentPosition, fWhiteStart, fWhiteStartPosition
 
Fields inherited from class info.bliki.wiki.filter.WikipediaScanner
EOF, fScannerPosition, fSource, fStringSource, fWikiModel, TAG_NAME
 
Constructor Summary
WikipediaParser(java.lang.String stringSource, boolean renderTemplate)
           
WikipediaParser(java.lang.String stringSource, boolean renderTemplate, IEventListener wikiListener)
           
 
Method Summary
protected  boolean getNextChar(char testedChar)
           
protected  int getNextChar(char testedChar1, char testedChar2)
           
protected  boolean getNextCharAsDigit()
           
protected  boolean getNextCharAsDigit(int radix)
           
protected  boolean getNextCharAsWikiPluginIdentifierPart()
           
protected  int getNextToken()
           
protected  int getNumberOfChar(char testedChar)
           
 boolean isNoToC()
          Display no table of contents?
 boolean isTemplate()
          Determine if the currently parsed wiki text is a template text.
static void parse(java.lang.String rawWikiText, IWikiModel wikiModel, boolean parseTemplates, java.lang.Appendable templateParserBuffer)
          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 runParser()
           
 void setNoToC(boolean noToC)
          Set the no table of contents render mode
 
Methods inherited from class info.bliki.wiki.filter.AbstractParser
findWikiLinkEnd, getRedirectedTemplateContent, isEmptyLine, parsePHPBBCode, parseRecursiveInternal, parseRedirect, readUntil, readUntilChar, readUntilCharOrStopAtEOL, readUntilEOL, readUntilIgnoreCase, readWhitespaceUntilEndOfLine, readWhitespaceUntilStartOfLine
 
Methods inherited from class info.bliki.wiki.filter.WikipediaScanner
findNestedEnd, findNestedParamEnd, findNestedTemplateEnd, getPosition, indexEndOfComment, indexEndOfNowiki, indexEndOfTable, indexOfAttributes, indexOfUntilNoLetter, makeTag, nextNewline, parseAttributes, parseTag, readSpecialWikiTags, readUntilIgnoreCase, replaceTemplateParameters, scanWhiteSpace, setModel, setPosition, splitByPipe, splitByPipe, startsWith, tracTable, wpList, wpTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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

getNextChar

protected final boolean getNextChar(char testedChar)

getNextChar

protected final int getNextChar(char testedChar1,
                                char testedChar2)

getNextCharAsDigit

protected final boolean getNextCharAsDigit()

getNextCharAsDigit

protected final boolean getNextCharAsDigit(int radix)

getNumberOfChar

protected final int getNumberOfChar(char testedChar)

getNextCharAsWikiPluginIdentifierPart

protected boolean getNextCharAsWikiPluginIdentifierPart()

getNextToken

protected int getNextToken()

runParser

public void runParser()
Specified by:
runParser in class AbstractParser

isNoToC

public boolean isNoToC()
Description copied from interface: IParser
Display no table of contents?

Specified by:
isNoToC in interface IParser
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
Specified by:
setNoToC in class AbstractParser

parse

public static void parse(java.lang.String rawWikiText,
                         IWikiModel wikiModel,
                         boolean parseTemplates,
                         java.lang.Appendable templateParserBuffer)
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:
rawWikitext - the raw text of the article
wikiModel - a suitable wiki model for the given wiki article text
parseTemplates - parse the template expansion step
templateParserBuffer - if the templateParserBuffer != null the templateParserBuffer will be used to append the result of the template expansion step

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()
Determine if the currently parsed wiki text is a template text.

Specified by:
isTemplate in interface IParser
Returns:
true if the currently parsed wiki text is a template


Copyright © 2012 Java Wikipedia API (Bliki engine). All Rights Reserved.