|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.bliki.wiki.filter.WikipediaScanner
info.bliki.wiki.filter.AbstractParser
info.bliki.wiki.filter.WikipediaParser
public class WikipediaParser
A Wikipedia syntax parser for the second pass in the parsing of a Wikipedia source text.
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 |
---|
public WikipediaParser(java.lang.String stringSource, boolean renderTemplate)
public WikipediaParser(java.lang.String stringSource, boolean renderTemplate, IEventListener wikiListener)
Method Detail |
---|
protected final boolean getNextChar(char testedChar)
protected final int getNextChar(char testedChar1, char testedChar2)
protected final boolean getNextCharAsDigit()
protected final boolean getNextCharAsDigit(int radix)
protected final int getNumberOfChar(char testedChar)
protected boolean getNextCharAsWikiPluginIdentifierPart()
protected int getNextToken()
public void runParser()
runParser
in class AbstractParser
public boolean isNoToC()
IParser
isNoToC
in interface IParser
public void setNoToC(boolean noToC)
IParser
setNoToC
in interface IParser
setNoToC
in class AbstractParser
public static void parse(java.lang.String rawWikiText, IWikiModel wikiModel, boolean parseTemplates, java.lang.Appendable templateParserBuffer)
setUp()
method before parsing and the tearDown()
method after the parser has finished.
rawWikitext
- the raw text of the articlewikiModel
- a suitable wiki model for the given wiki article textparseTemplates
- parse the template expansion steptemplateParserBuffer
- if the templateParserBuffer != null
the
templateParserBuffer
will be used to append the
result of the template expansion steppublic static void parseRecursive(java.lang.String rawWikitext, IWikiModel wikiModel)
setUp()
or
tearDown()
methods for the subsequent recursive parser steps.
rawWikitext
- wikiModel
- public static TagStack parseRecursive(java.lang.String rawWikitext, IWikiModel wikiModel, boolean createOnlyLocalStack, boolean noTOC)
setUp()
or
tearDown()
methods for the subsequent recursive parser steps.
rawWikitext
- wikiModel
- noTOC
- appendStack
-
public boolean isTemplate()
isTemplate
in interface IParser
true
if the currently parsed wiki text is a template
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |