info.bliki.wiki.filter
Class AbstractParser

java.lang.Object
  extended by info.bliki.wiki.filter.WikipediaScanner
      extended by info.bliki.wiki.filter.AbstractParser
Direct Known Subclasses:
TemplateParser, WikipediaParser

public abstract class AbstractParser
extends WikipediaScanner


Field Summary
protected  char fCurrentCharacter
          The current scanned character
protected  int fCurrentPosition
          The current offset in the character source array
protected  boolean fWhiteStart
           
protected  int fWhiteStartPosition
           
 
Fields inherited from class info.bliki.wiki.filter.WikipediaScanner
EOF, fScannerPosition, fSource, fStringSource, fWikiModel, TAG_NAME
 
Constructor Summary
AbstractParser(java.lang.String stringSource)
           
 
Method Summary
protected  boolean findWikiLinkEnd()
          Read the characters until the end position of the current wiki link is found
static java.lang.String getRedirectedTemplateContent(IWikiModel wikiModel, java.lang.String redirectedLink, java.util.Map<java.lang.String,java.lang.String> templateParameters)
           
protected  boolean isEmptyLine(int diff)
           
protected  boolean parsePHPBBCode(java.lang.String name, java.lang.StringBuilder bbCode)
           
 TagStack parseRecursiveInternal(IWikiModel wikiModel, boolean createOnlyLocalStack, boolean noTOC)
           
static java.lang.String parseRedirect(java.lang.String rawWikiText, IWikiModel wikiModel)
          Check the text for a #REDIRECT [[...]]
protected  boolean readUntil(java.lang.String untilString)
          Read the characters until the given string is found
protected  boolean readUntilChar(char testedChar)
          Read until character is found
protected  boolean readUntilCharOrStopAtEOL(char testedChar)
          Read until character is found or stop at end-of-line
protected  boolean readUntilEOL()
          Read until the end-of-line characters (i.e.
protected  boolean readUntilIgnoreCase(java.lang.String startString, java.lang.String endString)
          Read the characters until the concatenated start and end substring is found.
protected  int readWhitespaceUntilEndOfLine(int diff)
           
protected  int readWhitespaceUntilStartOfLine(int diff)
           
abstract  void runParser()
           
abstract  void setNoToC(boolean noToC)
           
 
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
 

Field Detail

fCurrentCharacter

protected char fCurrentCharacter
The current scanned character


fCurrentPosition

protected int fCurrentPosition
The current offset in the character source array


fWhiteStart

protected boolean fWhiteStart

fWhiteStartPosition

protected int fWhiteStartPosition
Constructor Detail

AbstractParser

public AbstractParser(java.lang.String stringSource)
Method Detail

readUntil

protected final boolean readUntil(java.lang.String untilString)
Read the characters until the given string is found

Parameters:
untilString -
Returns:

readUntilIgnoreCase

protected final boolean readUntilIgnoreCase(java.lang.String startString,
                                            java.lang.String endString)
Read the characters until the concatenated start and end substring is found. The end substring is matched ignoring case considerations.

Parameters:
startString - the start string which should be searched in exact case mode
endString - the end string which should be searched in ignore case mode
Returns:

readUntilChar

protected final boolean readUntilChar(char testedChar)
Read until character is found

Parameters:
testedChar - search the next position of this char
Returns:
true if the tested character can be found

readUntilCharOrStopAtEOL

protected final boolean readUntilCharOrStopAtEOL(char testedChar)
Read until character is found or stop at end-of-line

Parameters:
testedChar - search the next position of this char
Returns:
true if the tested character can be found

readUntilEOL

protected final boolean readUntilEOL()
Read until the end-of-line characters (i.e. '\r' or '\n') or the end of the string is reached

Parameters:
fName -
Returns:
true if the end-of-line characters or the end of the string is reached

isEmptyLine

protected boolean isEmptyLine(int diff)

readWhitespaceUntilEndOfLine

protected int readWhitespaceUntilEndOfLine(int diff)

readWhitespaceUntilStartOfLine

protected int readWhitespaceUntilStartOfLine(int diff)

parsePHPBBCode

protected boolean parsePHPBBCode(java.lang.String name,
                                 java.lang.StringBuilder bbCode)

parseRecursiveInternal

public TagStack parseRecursiveInternal(IWikiModel wikiModel,
                                       boolean createOnlyLocalStack,
                                       boolean noTOC)

findWikiLinkEnd

protected final boolean findWikiLinkEnd()
Read the characters until the end position of the current wiki link is found

Returns:

setNoToC

public abstract void setNoToC(boolean noToC)

runParser

public abstract void runParser()

getRedirectedTemplateContent

public static java.lang.String getRedirectedTemplateContent(IWikiModel wikiModel,
                                                            java.lang.String redirectedLink,
                                                            java.util.Map<java.lang.String,java.lang.String> templateParameters)

parseRedirect

public static java.lang.String parseRedirect(java.lang.String rawWikiText,
                                             IWikiModel wikiModel)
Check the text for a #REDIRECT [[...]] or #redirect [[...]] link

Parameters:
rawWikiText - the wiki text
wikiModel -
Returns:
null if a redirect was found and further parsing should be canceled according to the model.


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