info.bliki.wiki.template
Class AbstractTemplateFunction

java.lang.Object
  extended by info.bliki.wiki.template.AbstractTemplateFunction
All Implemented Interfaces:
ITemplateFunction
Direct Known Subclasses:
Allmacros, Anchorencode, DollarContext, Expr, Formatnum, Fullurl, If, Ifeq, Iferror, Ifexist, Ifexpr, LC, LCFirst, Localurl, NS, Padleft, Padright, Plural, Safesubst, Subst, Switch, Tag, Time, UC, UCFirst, URLEncode

public abstract class AbstractTemplateFunction
extends java.lang.Object
implements ITemplateFunction

A template parser function for {{ #if: ... }} syntax


Constructor Summary
AbstractTemplateFunction()
           
 
Method Summary
 java.lang.String getFunctionDoc()
          Return a short description of the implemented template function
 java.lang.String parse(java.lang.String plainContent, IWikiModel model)
          Parse the given plain content string with the template parser.
 java.lang.String parseFunction(char[] src, int beginIndex, int endIndex, IWikiModel model)
           
abstract  java.lang.String parseFunction(java.util.List<java.lang.String> parts, IWikiModel model, char[] src, int beginIndex, int endIndex)
          Parse a template function (like for example {{ #if: ... }}) The result is also a text string in Wikipedia syntax notation which will be parsed again (recursively) in the TemplateParser step.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTemplateFunction

public AbstractTemplateFunction()
Method Detail

parseFunction

public java.lang.String parseFunction(char[] src,
                                      int beginIndex,
                                      int endIndex,
                                      IWikiModel model)
                               throws java.io.IOException
Throws:
java.io.IOException

getFunctionDoc

public java.lang.String getFunctionDoc()
Description copied from interface: ITemplateFunction
Return a short description of the implemented template function

Specified by:
getFunctionDoc in interface ITemplateFunction
Returns:

parseFunction

public abstract java.lang.String parseFunction(java.util.List<java.lang.String> parts,
                                               IWikiModel model,
                                               char[] src,
                                               int beginIndex,
                                               int endIndex)
                                        throws java.io.IOException
Description copied from interface: ITemplateFunction
Parse a template function (like for example {{ #if: ... }}) The result is also a text string in Wikipedia syntax notation which will be parsed again (recursively) in the TemplateParser step.

Specified by:
parseFunction in interface ITemplateFunction
Parameters:
parts - the parser function arguments (extracted from the wiki text by splitting the string at the pipe symbol ´|´)
model - the wiki model
src - the array of the current Wikipedia source text
beginIndex - the beginning index, inclusive.
endIndex - the ending index, exclusive.
Returns:
the result string of this template function or null if the parsing fails or isn't valid
Throws:
java.io.IOException
See Also:
TemplateParser#parseTemplate(StringBuffer)

parse

public java.lang.String parse(java.lang.String plainContent,
                              IWikiModel model)
Parse the given plain content string with the template parser.

Parameters:
plainContent -
model -
Returns:


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