info.bliki.wiki.model
Interface IWikiModel

All Superinterfaces:
IConfiguration
All Known Implementing Classes:
AbstractWikiModel, BBCodeModel, PDFWikiModel, WikiModel

public interface IWikiModel
extends IConfiguration

Interface for rendering a wiki model


Method Summary
 void addCategory(java.lang.String categoryName, java.lang.String sortKey)
          When an article contains a token indicating that the article belongs to a specific category this method should be called to add that category to the output metadata.
 void addLink(java.lang.String topicName)
          When a document contains a token indicating that the document links to another Wiki topic this method should be called to add that topic link to the output metadata.
 boolean addSemanticAttribute(java.lang.String attribute, java.lang.String attributeValue)
          See Semantic MediaWiki for more information.
 boolean addSemanticRelation(java.lang.String relation, java.lang.String relationValue)
          See Semantic MediaWiki for more information.
 void addTemplate(java.lang.String template)
          When a document contains a token indicating that the document includes a Wiki template this method should be called to add that template to the output metadata.
 java.lang.String[] addToReferences(java.lang.String reference, java.lang.String nameAttribute)
          Add a reference (i.e. footnote) to the internal list
 void append(BaseToken contentNode)
          Append the content as a child on the top node of the internal stack
 void appendExternalImageLink(java.lang.String imageSrc, java.lang.String imageAltText)
          Append an external wiki image link (starting with http, https,... and ending with gif, png, jpg, bmp)
 void appendExternalLink(java.lang.String link, java.lang.String linkName, boolean withoutSquareBrackets)
          Deprecated. use appendExternalLink(String, String, String, boolean) instead.
 void appendExternalLink(java.lang.String uriSchemeName, java.lang.String link, java.lang.String linkName, boolean withoutSquareBrackets)
          Append an external link (starting with http, https, ftp,...) as described in Help Links
 ITableOfContent appendHead(java.lang.String rawHead, int headLevel, boolean noToC, int headCounter)
          Deprecated.  
 ITableOfContent appendHead(java.lang.String rawHead, int headLevel, boolean noToC, int headCounter, int startPosition, int endPosition)
          Add a single wiki head (i.e. ==...==, ===...===, ====...====,...) to the table of content
 void appendInternalImageLink(java.lang.String hrefImageLink, java.lang.String srcImageLink, ImageFormat imageFormat)
          Append this internal wiki image link.
 void appendInternalLink(java.lang.String topic, java.lang.String hashSection, java.lang.String topicDescription, java.lang.String cssClass, boolean parseRecursive)
          Append an internal wikilink as described in Help Links
 void appendInterWikiLink(java.lang.String namespace, java.lang.String title, java.lang.String linkText)
          Append an InterWiki link
 void appendISBNLink(java.lang.String isbnPureText)
          Append an external ISBN link (starting with ISBN ) as described in Wikipedia:ISBN

Note: The default implementation in the AbstractWikiModel class creates a link to Amazon.com.
 void appendMailtoLink(java.lang.String link, java.lang.String linkName, boolean withoutSquareBrackets)
          Append an external link (starting with mailto:...) as described in Help:Wikitext#Links
 boolean appendRawNamespaceLinks(java.lang.String rawNamespaceTopic, java.lang.String viewableLinkDescription, boolean containsNoPipe)
          Check if the topic is a special namespace topic.
 void appendRawWikipediaLink(java.lang.String rawLinkText, java.lang.String suffix)
          Main entry method for parsing a raw wiki link (i.e. the text between the [[...]] square brackets).
 boolean appendRedirectLink(java.lang.String redirectLink)
          Append the redirect link to the model
 void appendSignature(java.lang.Appendable writer, int numberOfTildes)
          Append the user signature to the writer (i.e. '~~~', '~~~~' or '~~~~').
 void appendStack(TagStack stack)
          Append the given tag stack to the current tag stack of the model.
 void buildEditLinkUrl(int section)
          Build the link to edit a section of the wikipedia article
 AbstractParser createNewInstance(java.lang.String rawWikitext)
          Create a new parser instance
 ITableOfContent createTableOfContent(boolean isTOCIdentifier)
          Create the "table of content" placeholder
 int decrementRecursionLevel()
          Decrement the current recursion level of the parser.
 java.lang.String encodeTitleDotUrl(java.lang.String wikiTitle, boolean firstCharacterAsUpperCase)
          Encode the wiki links title into a URL for HTML hyperlinks (i.e.
 java.lang.String encodeTitleToUrl(java.lang.String wikiTitle, boolean firstCharacterAsUpperCase)
          Encode the wiki links title into a URL for HTML hyperlinks (i.e.
 java.lang.String get2ndCategoryNamespace()
          Get the secondary namespace (i.e. the namespace for a non-englich locale) for categories in this wiki
 java.lang.String get2ndImageNamespace()
          Get the secondary namespace (i.e. the namespace for a non-englich locale) for images in this wiki
 java.lang.String get2ndTemplateNamespace()
          Get the secondary namespace (i.e. the namespace for a non-englich locale) for templates in this wiki
 java.lang.String getCategoryNamespace()
          Get the primary namespace for categories in this wiki
 java.util.Date getCurrentTimeStamp()
          Get the current time stamp.
 java.lang.String getImageNamespace()
          Get the primary namespace for images in this wiki
 java.util.Set<java.lang.String> getLinks()
          Get the set of Wikipedia link names
 java.util.Locale getLocale()
          Get the locale of this model.
 INamespace getNamespace()
          Get the namespace of this model.
 int getNextNumber()
          Get the next unique number
 TagToken getNode(int offset)
          Get the node at the given offset on the internal stack For example getNode(fWikiModel.stackSize() - 2) returns the node before the node at top of the stack.
 java.lang.String getPageName()
          Get the title of the current wiki article.
 java.lang.String getRawWikiContent(java.lang.String namespace, java.lang.String templateName, java.util.Map<java.lang.String,java.lang.String> templateParameters)
          Get the raw wiki text for the given namespace and article name
 int getRecursionLevel()
          Get the current recursion level of the parser.
 java.lang.String getRedirectLink()
          Get the redirect link.
 java.util.List<Reference> getReferences()
          Get the internal list of references (i.e. footnotes)
 java.util.ResourceBundle getResourceBundle()
          Get the resource bundle associated with this model for I18N support
 java.util.List<SemanticAttribute> getSemanticAttributes()
          Get the list of SemanticAttributes
 java.util.List<SemanticRelation> getSemanticRelations()
          Get the list of SemanticRelations.
 ITableOfContent getTableOfContent()
          Get the parsed "table of content" data after parsing the Wikipedia text.
 ITemplateFunction getTemplateFunction(java.lang.String name)
          Get a template parser function (i.e.
 java.lang.String getTemplateNamespace()
          Get the primary namespace for templates in this wiki model
 IEventListener getWikiListener()
          Get the current defined wiki listener
 int incrementParserRecursionCount()
           
 int incrementRecursionLevel()
          Increment the current recursion level of the parser.
 int incrementTemplateRecursionCount()
           
 boolean isCamelCaseEnabled()
          Checks if CamelCase words should also be used as wiki links.
 boolean isCategoryNamespace(java.lang.String namespace)
          Check if the given namespace is a category namespace
 boolean isEditorMode()
          The current model is used to render a wikipage in editor mode
 boolean isImageNamespace(java.lang.String namespace)
          Check if the given namespace is an image namespace
 boolean isInterWiki(java.lang.String namespace)
          Check if the given namespace is an interwiki link prefix.
 boolean isMathtranRenderer()
          If the <math> tag should be rendered for the www.mathtran.org service, then return true.
 boolean isNamespace(java.lang.String namespace)
          Check if the given namespace is a namespace in this model
 boolean isPreviewMode()
          The current model is used to render a wikipage in preview mode
 boolean isSemanticWebActive()
          Allow the parsing of semantic mediawiki (SMW) links.
 boolean isTemplateNamespace(java.lang.String namespace)
          Check if the given namespace is a template namespace
 boolean isTemplateTopic()
          Determine if the currently parsed wiki text is a template.
 boolean isValidUriScheme(java.lang.String uriScheme)
          Check if the top level URI (Uniform Resource Identifier) scheme name is valid in this model.
 boolean isValidUriSchemeSpecificPart(java.lang.String uriScheme, java.lang.String uriSchemeSpecificPart)
          Check if the scheme-specific part for a given top level URI (Uniform Resource Identifier) scheme name is valid in this model.
 boolean parseBBCodes()
          Parse BBCode (Bulletin Board Code), like syntax codes in this wiki.
 void parseEvents(IEventListener listener, java.lang.String rawWikiText)
          Parse the raw Wikipedia text and notify the listener
 void parseInternalImageLink(java.lang.String imageNamespace, java.lang.String rawImageLink)
          Append the internal wiki image link to this model.
 java.lang.String parseTemplates(java.lang.String rawWikiText)
          Parse the templates in a raw wikipedia text into a resulting wikipedia text.
 java.lang.String parseTemplates(java.lang.String rawWikiText, boolean parseOnlySignature)
          Parse the templates in a raw wikipedia text into a resulting wikipedia text.
 TagToken peekNode()
          Get the current TagNode on top of the internal stack
 TagToken popNode()
          Pop the current TagNode from top of the internal stack
 boolean pushNode(TagToken node)
          Push the given TagNode on top of the internal stack
 java.lang.String render(ITextConverter converter, java.lang.String rawWikiText)
          Render the raw Wikipedia text into a string for a given converter
 java.lang.String render(java.lang.String rawWikiText)
          Render the raw Wikipedia text into an HTML string and use the default HTMLConverter
 java.lang.String renderPDF(java.lang.String rawWikiText)
          Render the raw Wikipedia text into an HTML string and use the default PDFConverter.
 boolean replaceColon()
          Replace a colon ':' with a slash '/' in wiki names (i.e. links, categories, templates)
 void setPageName(java.lang.String pageTitle)
          Set the title of the currently rendered page data.
 void setSemanticWebActive(boolean semanticWeb)
          Activate the parsing of semantic Mediawiki (SMW) links See Semantic MediaWiki for more information.
 void setUp()
          Prepare or initialize the wiki model before rendering the wikipedia text
 boolean showSyntax(java.lang.String tagName)
          Show the syntax highlighting of the source code
 int stackSize()
          The size of the internal stack
 void substituteTemplateCall(java.lang.String templateName, java.util.Map<java.lang.String,java.lang.String> parameterMap, java.lang.Appendable writer)
          Substitute the template name by the template content and parameters and append the new content to the writer.
 TagStack swapStack(TagStack stack)
           
 void tearDown()
          Clean up (i.e. free internal resources) in the wiki model after rendering the wikipedia text, if necessary
 
Methods inherited from interface info.bliki.wiki.model.IConfiguration
addCodeFormatter, addInterwikiLink, addTemplateFunction, addTokenTag, getCodeFormatterMap, getInterwikiMap, getTemplateCallsCache, getTemplateMap, getTokenMap, getUriSchemeSet, setTemplateCallsCache
 

Method Detail

addCategory

void addCategory(java.lang.String categoryName,
                 java.lang.String sortKey)
When an article contains a token indicating that the article belongs to a specific category this method should be called to add that category to the output metadata. For the sortKey see also Wikipedia:Categorization#Category_sorting

Parameters:
categoryName - The name of the category that the document belongs to.
sortKey - The sort key for the category, or null if no sort key has been specified. The sort key determines what order categories are sorted on category index pages, so a category for "John Doe" might be given a sort key of "Doe, John".

addLink

void addLink(java.lang.String topicName)
When a document contains a token indicating that the document links to another Wiki topic this method should be called to add that topic link to the output metadata.

Parameters:
topicName - The name of the topic that is linked to.

addSemanticAttribute

boolean addSemanticAttribute(java.lang.String attribute,
                             java.lang.String attributeValue)
See Semantic MediaWiki for more information.

Parameters:
attribute -
attributeValue -
Returns:

addSemanticRelation

boolean addSemanticRelation(java.lang.String relation,
                            java.lang.String relationValue)
See Semantic MediaWiki for more information.

Parameters:
relation -
relationValue -
Returns:

addTemplate

void addTemplate(java.lang.String template)
When a document contains a token indicating that the document includes a Wiki template this method should be called to add that template to the output metadata.

Parameters:
template - The name of the template that is being included.

addToReferences

java.lang.String[] addToReferences(java.lang.String reference,
                                   java.lang.String nameAttribute)
Add a reference (i.e. footnote) to the internal list

Parameters:
reference - the rendered HTML code of the ref-Tag body
nameAttribute - the value of the name attribute or null
Returns:
the current offset (i.e. size()-1) of the element in the list

append

void append(BaseToken contentNode)
Append the content as a child on the top node of the internal stack

Parameters:
contentNode -

appendExternalImageLink

void appendExternalImageLink(java.lang.String imageSrc,
                             java.lang.String imageAltText)
Append an external wiki image link (starting with http, https,... and ending with gif, png, jpg, bmp)

Parameters:
imageSrc -
hashSection -
imageAltText -

appendExternalLink

void appendExternalLink(java.lang.String link,
                        java.lang.String linkName,
                        boolean withoutSquareBrackets)
Deprecated. use appendExternalLink(String, String, String, boolean) instead.

Append an external link (starting with http, https, ftp,...) as described in Help Links

Parameters:
link - the external link with http://, https:// or ftp:// prefix
linkName - the link name which is separated from the URL by a space
withoutSquareBrackets - if true a link with no square brackets around the link was parsed

appendExternalLink

void appendExternalLink(java.lang.String uriSchemeName,
                        java.lang.String link,
                        java.lang.String linkName,
                        boolean withoutSquareBrackets)
Append an external link (starting with http, https, ftp,...) as described in Help Links

Parameters:
uriSchemeName - the top level URI (Uniform Resource Identifier) scheme name (without the following colon character ":"). Example "ftp", "http", "https". See URI scheme
link - the external link with http://, https:// or ftp:// prefix
linkName - the link name which is separated from the URL by a space
withoutSquareBrackets - if true a link with no square brackets around the link was parsed

appendHead

ITableOfContent appendHead(java.lang.String rawHead,
                           int headLevel,
                           boolean noToC,
                           int headCounter)
Deprecated. 

Add a single wiki head (i.e. ==...==, ===...===, ====...====,...) to the table of content

Parameters:
rawHead - the unparsed header string
headLevel - level of header (i.e. h1, h2, h3, h4, 5h,..)
noToc - don't show the "table of content"
headCounter - the total number of headers parsed
Returns:
the "table of content" tag

appendHead

ITableOfContent appendHead(java.lang.String rawHead,
                           int headLevel,
                           boolean noToC,
                           int headCounter,
                           int startPosition,
                           int endPosition)
Add a single wiki head (i.e. ==...==, ===...===, ====...====,...) to the table of content

Parameters:
rawHead - the unparsed header string
headLevel - level of header (i.e. h1, h2, h3, h4, 5h,..)
noToc - don't show the "table of content"
headCounter - the total number of headers parsed
startPosition - the start index in the text where the header line of the section begins
endPosition - the start index in the text where the header line of the section ends
Returns:
the "table of content" tag

appendInternalImageLink

void appendInternalImageLink(java.lang.String hrefImageLink,
                             java.lang.String srcImageLink,
                             ImageFormat imageFormat)
Append this internal wiki image link. In the current implementation some parts of the image rendering are moved to the HTMLConverter#imageNodeToText() method.

Parameters:
hrefImageLink -
srcImageLink -
imageFormat -

appendInternalLink

void appendInternalLink(java.lang.String topic,
                        java.lang.String hashSection,
                        java.lang.String topicDescription,
                        java.lang.String cssClass,
                        boolean parseRecursive)
Append an internal wikilink as described in Help Links

Parameters:
topic -
hashSection -
topicDescription -
cssClass - the links CSS class style
parseRecursive - TODO

appendInterWikiLink

void appendInterWikiLink(java.lang.String namespace,
                         java.lang.String title,
                         java.lang.String linkText)
Append an InterWiki link

Parameters:
namespace -
title -
linkText -

appendISBNLink

void appendISBNLink(java.lang.String isbnPureText)
Append an external ISBN link (starting with ISBN ) as described in Wikipedia:ISBN

Note: The default implementation in the AbstractWikiModel class creates a link to Amazon.com.

Parameters:
isbnPureText - the pure ISBN string which contains the ISBN prefix and optional dashes in the ISBN number

appendMailtoLink

void appendMailtoLink(java.lang.String link,
                      java.lang.String linkName,
                      boolean withoutSquareBrackets)
Append an external link (starting with mailto:...) as described in Help:Wikitext#Links

Parameters:
link - the external link with mailto: prefix
linkName - the link name which is separated from the URL by a space
withoutSquareBrackets - if true a mailto link with no square brackets around the link was parsed

appendRawNamespaceLinks

boolean appendRawNamespaceLinks(java.lang.String rawNamespaceTopic,
                                java.lang.String viewableLinkDescription,
                                boolean containsNoPipe)
Check if the topic is a special namespace topic. In the AbstractWikiModel defaults implementation this namespace topic is parsed and checks for various namespaces, like Categories and Interwiki links.

Parameters:
rawNamespaceTopic - the text between the [[...]] square brackets of a wiki link before the pipe symbol
viewableLinkDescription -
containsNoPipe - set to true if the rawLinkText contained no pipe symbol.
Returns:
true if the topic is a special namespace topic

appendRawWikipediaLink

void appendRawWikipediaLink(java.lang.String rawLinkText,
                            java.lang.String suffix)
Main entry method for parsing a raw wiki link (i.e. the text between the [[...]] square brackets). In the AbstractWikiModel defaults implementation this link is parsed and the various other append... methods of the model are called for the different cases.

Parameters:
rawLinkText - the text between the [[...]] square brackets of a wiki link
suffix - a String of lowercase letters which directly follow the link after the closing ]] brackets. Useful for topic plurals.

appendRedirectLink

boolean appendRedirectLink(java.lang.String redirectLink)
Append the redirect link to the model

Parameters:
redirectLink - the raw string between the wikilink tags [[ ]]
Returns:
true if the the wikitext shouldn't be parsed

appendSignature

void appendSignature(java.lang.Appendable writer,
                     int numberOfTildes)
                     throws java.io.IOException
Append the user signature to the writer (i.e. '~~~', '~~~~' or '~~~~'). This method is used in the first pass of parsing the wiki text (together with template parsing). You can append a [[User:xxxx]] string according to your model.

Parameters:
writer -
numberOfTildes - an int value between 3 and 5
Throws:
java.io.IOException

appendStack

void appendStack(TagStack stack)
Append the given tag stack to the current tag stack of the model.

Parameters:
stack -

buildEditLinkUrl

void buildEditLinkUrl(int section)
Build the link to edit a section of the wikipedia article

Parameters:
section -

createNewInstance

AbstractParser createNewInstance(java.lang.String rawWikitext)
Create a new parser instance

Parameters:
rawWikitext -
Returns:

createTableOfContent

ITableOfContent createTableOfContent(boolean isTOCIdentifier)
Create the "table of content" placeholder

Parameters:
isTOCIdentifier - true if the __TOC__ keyword was parsed
Returns:
the "table of content" tag

decrementRecursionLevel

int decrementRecursionLevel()
Decrement the current recursion level of the parser. The recursion level is used to prevent infinite nesting of templates, tables, lists and other parser objects.

Returns:
the decremented recursion level

encodeTitleDotUrl

java.lang.String encodeTitleDotUrl(java.lang.String wikiTitle,
                                   boolean firstCharacterAsUpperCase)
Encode the wiki links title into a URL for HTML hyperlinks (i.e. create the href attribute representation for the a tag). This method uses the '.' character to encode special characters. To get the behavior of the MediaWiki software, which is configured to convert the first letter to upper case, the firstCharacterAsUpperCase parameters must be set to true. For an example encoding routine see: Encoder.encodeTitleDotUrl(String, boolean)

Parameters:
firstCharacterAsUpperCase - if true convert the first of the title to uppercase
See Also:
Encoder.encodeTitleToUrl(String, boolean)

encodeTitleToUrl

java.lang.String encodeTitleToUrl(java.lang.String wikiTitle,
                                  boolean firstCharacterAsUpperCase)
Encode the wiki links title into a URL for HTML hyperlinks (i.e. create the href attribute representation for the a tag). This method uses the '%' character to encode special characters. To get the behavior of the MediaWiki software, which is configured to convert the first letter to upper case, the firstCharacterAsUpperCase parameters must be set to true. For an example encoding routine see Encoder.encodeTitleToUrl(String, boolean)

Parameters:
firstCharacterAsUpperCase - if true convert the first of the title to uppercase
See Also:
Encoder.encodeTitleToUrl(String, boolean)

get2ndCategoryNamespace

java.lang.String get2ndCategoryNamespace()
Get the secondary namespace (i.e. the namespace for a non-englich locale) for categories in this wiki

Returns:
the secondary category namespace

get2ndImageNamespace

java.lang.String get2ndImageNamespace()
Get the secondary namespace (i.e. the namespace for a non-englich locale) for images in this wiki

Returns:
the secondary image namespace

get2ndTemplateNamespace

java.lang.String get2ndTemplateNamespace()
Get the secondary namespace (i.e. the namespace for a non-englich locale) for templates in this wiki

Returns:
the secondary template namespace

getCategoryNamespace

java.lang.String getCategoryNamespace()
Get the primary namespace for categories in this wiki

Returns:
the primary category namespace

getCurrentTimeStamp

java.util.Date getCurrentTimeStamp()
Get the current time stamp. This is the value for the magic word "CURRENTTIMESTAMP". This method typically returns the value new Date(System.currentTimeMillis());.

Returns:

getImageNamespace

java.lang.String getImageNamespace()
Get the primary namespace for images in this wiki

Returns:
the primary image namespace

getLinks

java.util.Set<java.lang.String> getLinks()
Get the set of Wikipedia link names

Returns:
the Set of link names 8i.e. [[...]] links)

getLocale

java.util.Locale getLocale()
Get the locale of this model.

Returns:
the locale for this model.

getNamespace

INamespace getNamespace()
Get the namespace of this model.

Returns:
the namespace for this model

getNextNumber

int getNextNumber()
Get the next unique number

Returns:
the next int number.

getNode

TagToken getNode(int offset)
Get the node at the given offset on the internal stack For example getNode(fWikiModel.stackSize() - 2) returns the node before the node at top of the stack.

Parameters:
offset -
Returns:
the node at the given offset

getPageName

java.lang.String getPageName()
Get the title of the current wiki article.

Returns:

getRawWikiContent

java.lang.String getRawWikiContent(java.lang.String namespace,
                                   java.lang.String templateName,
                                   java.util.Map<java.lang.String,java.lang.String> templateParameters)
Get the raw wiki text for the given namespace and article name

Parameters:
namespace - the namespace of this article
templateName - the name of the template
templateParameters - if the namespace is the Template namespace, the current template parameters are stored as Strings in this map
Returns:
null if no content was found

getRecursionLevel

int getRecursionLevel()
Get the current recursion level of the parser. The recursion level is used to prevent infinite nesting of templates, tables, lists and other parser objects.

Returns:
the current recursion level counter

getRedirectLink

java.lang.String getRedirectLink()
Get the redirect link.

Returns:
the raw string between the wikilink tags [[ ]] or null if no redirect exists

getReferences

java.util.List<Reference> getReferences()
Get the internal list of references (i.e. footnotes)

Returns:
the list of references or null if no reference exists
See Also:
Reference

getResourceBundle

java.util.ResourceBundle getResourceBundle()
Get the resource bundle associated with this model for I18N support

Returns:
the currently used resource bundle for this wiki model

getSemanticAttributes

java.util.List<SemanticAttribute> getSemanticAttributes()
Get the list of SemanticAttributes

Returns:
the list of SemanticAttributes or null if no SemanticAttribute exists

getSemanticRelations

java.util.List<SemanticRelation> getSemanticRelations()
Get the list of SemanticRelations. See Semantic MediaWiki for more information.

Returns:
the list of SemanticRelations or null if no SemanticRelation exists

getTableOfContent

ITableOfContent getTableOfContent()
Get the parsed "table of content" data after parsing the Wikipedia text.

Returns:

getTemplateFunction

ITemplateFunction getTemplateFunction(java.lang.String name)
Get a template parser function (i.e. {{ #if: ... }} ) implementation.

Parameters:
name - the name of the function without the "#" and ":" delimiters
Returns:
the parser function or null if no function is available for the given name

getTemplateNamespace

java.lang.String getTemplateNamespace()
Get the primary namespace for templates in this wiki model

Returns:
the primary namespace for templates

getWikiListener

IEventListener getWikiListener()
Get the current defined wiki listener

Returns:
the wiki listener or null if no listener is defined

incrementParserRecursionCount

int incrementParserRecursionCount()

incrementRecursionLevel

int incrementRecursionLevel()
Increment the current recursion level of the parser. The recursion level is used to prevent infinite nesting of templates, tables, lists and other parser objects.

Returns:
the current recursion level counter

incrementTemplateRecursionCount

int incrementTemplateRecursionCount()

isCamelCaseEnabled

boolean isCamelCaseEnabled()
Checks if CamelCase words should also be used as wiki links.

Returns:
true if CamelCase words should also be used as wiki links

isCategoryNamespace

boolean isCategoryNamespace(java.lang.String namespace)
Check if the given namespace is a category namespace

Parameters:
namespace -
Returns:
true if the namespace is a category namespace.

isEditorMode

boolean isEditorMode()
The current model is used to render a wikipage in editor mode

Returns:
true if your model is used in an editor mode

isImageNamespace

boolean isImageNamespace(java.lang.String namespace)
Check if the given namespace is an image namespace

Parameters:
namespace -
Returns:
true if the namespace is a image namespace.

isInterWiki

boolean isInterWiki(java.lang.String namespace)
Check if the given namespace is an interwiki link prefix.

Parameters:
namespace -
Returns:
true if the namespace is a interwiki namespace (i.e. prefix).

isMathtranRenderer

boolean isMathtranRenderer()
If the <math> tag should be rendered for the www.mathtran.org service, then return true.

Returns:
true the <math> tag should be rendered fro mathtran.org.

isNamespace

boolean isNamespace(java.lang.String namespace)
Check if the given namespace is a namespace in this model

Parameters:
namespace -
Returns:
true if the namespace is a namespace in this model

isPreviewMode

boolean isPreviewMode()
The current model is used to render a wikipage in preview mode

Returns:
true if your model is used in a preview mode

isSemanticWebActive

boolean isSemanticWebActive()
Allow the parsing of semantic mediawiki (SMW) links. See Semantic MediaWiki for more information.

Parameters:
namespace -
Returns:
true if parsing of semantic mediawiki (SMW) links is enabled

isTemplateNamespace

boolean isTemplateNamespace(java.lang.String namespace)
Check if the given namespace is a template namespace

Parameters:
namespace -
Returns:
true if the namespace is a template namespace.

isTemplateTopic

boolean isTemplateTopic()
Determine if the currently parsed wiki text is a template.

Returns:
true if the currently parsed wiki text is a template

isValidUriScheme

boolean isValidUriScheme(java.lang.String uriScheme)
Check if the top level URI (Uniform Resource Identifier) scheme name is valid in this model. See URI scheme

Parameters:
uriScheme - the top level URI (Uniform Resource Identifier) scheme name (without the following colon character ":")
Returns:
true if the specified URI scheme is valid.
See Also:
isValidUriSchemeSpecificPart(String, String)

isValidUriSchemeSpecificPart

boolean isValidUriSchemeSpecificPart(java.lang.String uriScheme,
                                     java.lang.String uriSchemeSpecificPart)
Check if the scheme-specific part for a given top level URI (Uniform Resource Identifier) scheme name is valid in this model. See URI scheme

Parameters:
uriScheme - the top level URI (Uniform Resource Identifier) scheme name (without the following colon character ":")
uriSchemeSpecificPart - the URI (Uniform Resource Identifier) scheme part following the top level scheme name and the colon character ":"
Returns:
true if the specified URI scheme is valid.
See Also:
isValidUriScheme(String)

parseBBCodes

boolean parseBBCodes()
Parse BBCode (Bulletin Board Code), like syntax codes in this wiki. See http://en.wikipedia.org/wiki /BBCode for more information.

Returns:
true if the bbCodes should be parsed

parseEvents

void parseEvents(IEventListener listener,
                 java.lang.String rawWikiText)
Parse the raw Wikipedia text and notify the listener

Parameters:
listener - an event listener
rawWikiText - the raw wiki text

parseInternalImageLink

void parseInternalImageLink(java.lang.String imageNamespace,
                            java.lang.String rawImageLink)
Append the internal wiki image link to this model.

See Image markup and see Help:Images.

Parameters:
imageNamespace - the image namespace
rawImageLink - the raw image link text without the surrounding [[...]]

parseTemplates

java.lang.String parseTemplates(java.lang.String rawWikiText)
Parse the templates in a raw wikipedia text into a resulting wikipedia text.

Parameters:
rawWikiText -
Returns:

parseTemplates

java.lang.String parseTemplates(java.lang.String rawWikiText,
                                boolean parseOnlySignature)
Parse the templates in a raw wikipedia text into a resulting wikipedia text.

Parameters:
rawWikiText -
parseOnlySignature - if true parse only the signature wiki texts, no templates and wiki comment parsing
Returns:

peekNode

TagToken peekNode()
Get the current TagNode on top of the internal stack

Returns:
the current node

popNode

TagToken popNode()
Pop the current TagNode from top of the internal stack


pushNode

boolean pushNode(TagToken node)
Push the given TagNode on top of the internal stack

Returns:
true if the push on the internal stack was successful

render

java.lang.String render(ITextConverter converter,
                        java.lang.String rawWikiText)
Render the raw Wikipedia text into a string for a given converter

Parameters:
converter - a text converter. Note the converter may be null, if you only would like to analyze the raw wiki text and don't need to convert. This speeds up the parsing process.
rawWikiText - a raw wiki text
Returns:
null if an IOException occurs or converter==null

render

java.lang.String render(java.lang.String rawWikiText)
Render the raw Wikipedia text into an HTML string and use the default HTMLConverter

Parameters:
rawWikiText -
Returns:
null if an IOException occurs

renderPDF

java.lang.String renderPDF(java.lang.String rawWikiText)
Render the raw Wikipedia text into an HTML string and use the default PDFConverter. The resulting XHTML could be used as input for the Flying Saucer PDF renderer

Parameters:
rawWikiText -
Returns:
null if an IOException occurs

replaceColon

boolean replaceColon()
Replace a colon ':' with a slash '/' in wiki names (i.e. links, categories, templates)

Returns:

setPageName

void setPageName(java.lang.String pageTitle)
Set the title of the currently rendered page data.

Parameters:
pageTitle -

setSemanticWebActive

void setSemanticWebActive(boolean semanticWeb)
Activate the parsing of semantic Mediawiki (SMW) links See Semantic MediaWiki for more information.


setUp

void setUp()
Prepare or initialize the wiki model before rendering the wikipedia text


showSyntax

boolean showSyntax(java.lang.String tagName)
Show the syntax highlighting of the source code

Returns:

stackSize

int stackSize()
The size of the internal stack

Returns:

substituteTemplateCall

void substituteTemplateCall(java.lang.String templateName,
                            java.util.Map<java.lang.String,java.lang.String> parameterMap,
                            java.lang.Appendable writer)
                            throws java.io.IOException
Substitute the template name by the template content and parameters and append the new content to the writer.

Parameters:
templateName - the name of the template
parameterMap - the templates parameter java.util.SortedMap
writer - the buffer to append the substituted template content
Throws:
java.io.IOException

swapStack

TagStack swapStack(TagStack stack)

tearDown

void tearDown()
Clean up (i.e. free internal resources) in the wiki model after rendering the wikipedia text, if necessary



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