public class WikipediaParser extends AbstractWikipediaParser
for the first pass| Modifier and Type | Field and Description |
|---|---|
static String[] |
TOC_IDENTIFIERS |
BOLD, BOLDITALIC, ITALIC, TokenBOLD, TokenBOLDITALIC, TokenEOF, TokenIgnore, TokenITALIC, TokenSTARTfCurrentCharacter, fCurrentPosition, fWhiteStart, fWhiteStartPositionEOF, fScannerPosition, fSource, fStringSource, fWikiModel| Constructor and Description |
|---|
WikipediaParser(String stringSource,
boolean renderTemplate) |
WikipediaParser(String stringSource,
boolean renderTemplate,
IEventListener wikiListener) |
| Modifier and Type | Method and Description |
|---|---|
static void |
parse(String rawWikiText,
IWikiModel wikiModel,
boolean parseTemplates,
Appendable templateParserBuffer)
Call the parser on the first recursion level, where the text can contain
a table of contents (TOC).
|
static TagStack |
parseRecursive(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. |
static String |
parseRedirect(String rawWikiText,
IWikiModel wikiModel)
Check the text for a
#REDIRECT [[...]] or
#redirect [[...]] link |
void |
runParser() |
void |
setNoToC(boolean noToC) |
void |
setTemplateTag(boolean templateTag) |
createContentToken, getRedirectedRawContent, getRedirectedTemplateContent, parseHTMLCommentTags, parseRecursiveInternal, reduceStackUntilToken, reduceTokenStack, reduceTokenStackBoldItalicconsumeWhitespace, findWikiLinkEnd, getNextChar, getNextCharAsWhitespace, isEmptyLine, readUntil, readUntilCharOrStopAtEOL, readUntilIgnoreCase, readUntilNestedIgnoreCase, readWhitespaceUntilEndOfLine, readWhitespaceUntilStartOfLinefindNestedEnd, findNestedEndSingle, findNestedParamEnd, findNestedTemplateEnd, getPosition, indexEndOfComment, indexEndOfNowiki, indexEndOfTable, indexOfUntilNoLetter, makeTag, nextNewline, nextNewlineCell, parseAttributes, parseTag, readSpecialWikiTags, readUntilIgnoreCase, setModel, setPosition, splitByChar, splitByChar, splitByPipe, splitByPipe, startsWith, wpList, wpTablepublic static final String[] TOC_IDENTIFIERS
public WikipediaParser(String stringSource, boolean renderTemplate)
public WikipediaParser(String stringSource, boolean renderTemplate, IEventListener wikiListener)
public static String parseRedirect(String rawWikiText, IWikiModel wikiModel)
#REDIRECT [[...]] or
#redirect [[...]] linkrawWikiText - the wiki textwikiModel - the wikimodel to usenon-null if a redirect was found and further parsing
should be cancelled according to the model.public void runParser()
runParser in class AbstractWikipediaParserpublic void setNoToC(boolean noToC)
setNoToC in class AbstractWikipediaParserpublic void setTemplateTag(boolean templateTag)
templateTag - true if template calls should generate TemplateTagpublic static void parse(String rawWikiText, IWikiModel wikiModel, boolean parseTemplates, 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 TagStack parseRecursive(String rawWikitext, IWikiModel wikiModel, boolean createOnlyLocalStack, boolean noTOC)
setUp() or
tearDown() methods for the subsequent recursive parser
steps.Copyright © 2017 Java Wikipedia API (Bliki engine). All rights reserved.