info.bliki.wiki.model
Class Configuration

java.lang.Object
  extended by info.bliki.wiki.model.Configuration
All Implemented Interfaces:
IConfiguration

public class Configuration
extends java.lang.Object
implements IConfiguration

Common Configuration settings


Field Summary
static java.lang.String BLOCK_TAGS
           
protected static java.util.HashMap<java.lang.String,SourceCodeFormatter> CODE_FORMATTER_MAP
          Map the source code's language string to the code formatter implementation
static Configuration DEFAULT_CONFIGURATION
           
static int GLOBAL_RECURSION_LIMIT
          Limits the recursive call of the AbstractParser parser to a depth of GLOBAL_RECURSION_LIMIT
static HTMLTag HTML_BIG_OPEN
           
static HTMLTag HTML_BLOCKQUOTE_OPEN
           
static HTMLTag HTML_BOLD_OPEN
           
static HTMLTag HTML_CAPTION_OPEN
           
static HTMLTag HTML_CENTER_OPEN
           
static HTMLTag HTML_CITE_OPEN
           
static HTMLTag HTML_CODE_OPEN
           
static HTMLTag HTML_DD_OPEN
           
static HTMLTag HTML_DEL_OPEN
           
static HTMLTag HTML_DIV_OPEN
           
static HTMLTag HTML_DL_OPEN
           
static HTMLTag HTML_DT_OPEN
           
static HTMLTag HTML_EM_OPEN
           
static HTMLTag HTML_FONT_OPEN
           
static HTMLTag HTML_H1_OPEN
           
static HTMLTag HTML_H2_OPEN
           
static HTMLTag HTML_H3_OPEN
           
static HTMLTag HTML_H4_OPEN
           
static HTMLTag HTML_H5_OPEN
           
static HTMLTag HTML_H6_OPEN
           
static HTMLTag HTML_ITALIC_OPEN
           
static HTMLTag HTML_LI_OPEN
           
static HTMLTag HTML_OL_OPEN
           
static HTMLTag HTML_PARAGRAPH_OPEN
           
static HTMLTag HTML_PRE_OPEN
           
static HTMLTag HTML_S_OPEN
           
static HTMLTag HTML_SMALL_OPEN
           
static HTMLTag HTML_SPAN_OPEN
           
static HTMLTag HTML_STRIKE_OPEN
           
static HTMLTag HTML_STRONG_OPEN
           
static HTMLTag HTML_SUB_OPEN
           
static HTMLTag HTML_SUP_OPEN
           
static HTMLTag HTML_TABLE_OPEN
           
static HTMLTag HTML_TD_OPEN
           
static HTMLTag HTML_TH_OPEN
           
static HTMLTag HTML_TR_OPEN
           
static HTMLTag HTML_TT_OPEN
           
static HTMLTag HTML_U_OPEN
           
static HTMLTag HTML_UL_OPEN
           
static HTMLTag HTML_UNDERLINE_OPEN
           
static HTMLTag HTML_VAR_OPEN
           
static java.lang.String INLINE_TAGS
           
protected static java.util.Map<java.lang.String,java.lang.String> INTERWIKI_MAP
          Map from the interwiki shortcut to the real Interwiki-URL
static java.util.regex.Pattern NOWIKI_CLOSE_PATTERN
           
static java.util.regex.Pattern NOWIKI_OPEN_PATTERN
           
static int PARSER_RECURSION_LIMIT
          Limits the recursive call of the Wikipedia and Template parser to a depth of PARSER_RECURSION_LIMIT
static int RENDERER_RECURSION_LIMIT
          Limits the recursive call of the HTMLConverter renderer to a depth of RENDERER_RECURSION_LIMIT
static java.lang.String SPECIAL_BLOCK_TAGS
           
protected static java.util.HashMap<java.lang.String,TagToken> TAG_TOKEN_MAP
          Map the HTML token string to the correspoding TagToken implementation
static int TEMPLATE_BUFFER_LIMIT
          Limits the Scanner buffer.
static java.util.Map<java.lang.String,java.lang.String> TEMPLATE_CALLS_CACHE
           
protected static java.util.Map<java.lang.String,ITemplateFunction> TEMPLATE_FUNCTION_MAP
          Map the template's function name to the TemplateFunction implementation
static int TEMPLATE_RECURSION_LIMIT
          Limits the recursive call of the Template parser to a depth of TEMPLATE_RECURSION_LIMIT
static int TEMPLATE_VALUE_LIMIT
          Limits the template parameter value length
protected static java.util.Set<java.lang.String> URI_SCHEME_MAP
          Allowed URI schemes
 
Constructor Summary
Configuration()
           
 
Method Summary
 SourceCodeFormatter addCodeFormatter(java.lang.String key, SourceCodeFormatter value)
          Add a new source code formatter to the configuration
 java.lang.String addInterwikiLink(java.lang.String key, java.lang.String value)
          Add another Interwiki link to the configuration.
 ITemplateFunction addTemplateFunction(java.lang.String key, ITemplateFunction value)
          Add a new interwiki link to the configuration
 TagToken addTokenTag(java.lang.String key, TagToken value)
          Add a new HTML styled tag to the configuration
 boolean addUriScheme(java.lang.String uriKey)
          Add an allowed URI scheme shortcut like http, https, ftp,...
 boolean containsUriScheme(java.lang.String uriKey)
          Check if the URI scheme is allowed.
 java.util.Map<java.lang.String,SourceCodeFormatter> getCodeFormatterMap()
          Get the source code formatter map of built-in source code formatters
 java.util.Map<java.lang.String,java.lang.String> getInterwikiMap()
          Get the interwiki links map for converting interwiki links into external URLs.
 java.util.Map<java.lang.String,java.lang.String> getTemplateCallsCache()
          Get the currently configured cache implementation for template calls.
 java.util.Map<java.lang.String,ITemplateFunction> getTemplateMap()
          Get the template parser functions map of built-in template functions
 java.util.Map<java.lang.String,TagToken> getTokenMap()
          Get the HTML styled tag map for built-in tags
 java.util.Set<java.lang.String> getUriSchemeSet()
          Get the set of all allowed URI scheme shortcuts like http, https, ftp,...
 void setTemplateCallsCache(java.util.Map<java.lang.String,java.lang.String> map)
          Set a cache map implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOCK_TAGS

public static final java.lang.String BLOCK_TAGS
See Also:
Constant Field Values

INLINE_TAGS

public static final java.lang.String INLINE_TAGS
See Also:
Constant Field Values

SPECIAL_BLOCK_TAGS

public static final java.lang.String SPECIAL_BLOCK_TAGS
See Also:
Constant Field Values

HTML_EM_OPEN

public static final HTMLTag HTML_EM_OPEN

HTML_H1_OPEN

public static final HTMLTag HTML_H1_OPEN

HTML_H2_OPEN

public static final HTMLTag HTML_H2_OPEN

HTML_H3_OPEN

public static final HTMLTag HTML_H3_OPEN

HTML_H4_OPEN

public static final HTMLTag HTML_H4_OPEN

HTML_H5_OPEN

public static final HTMLTag HTML_H5_OPEN

HTML_H6_OPEN

public static final HTMLTag HTML_H6_OPEN

HTML_ITALIC_OPEN

public static final HTMLTag HTML_ITALIC_OPEN

HTML_BOLD_OPEN

public static final HTMLTag HTML_BOLD_OPEN

HTML_PARAGRAPH_OPEN

public static final HTMLTag HTML_PARAGRAPH_OPEN

HTML_BLOCKQUOTE_OPEN

public static final HTMLTag HTML_BLOCKQUOTE_OPEN

HTML_STRIKE_OPEN

public static final HTMLTag HTML_STRIKE_OPEN

HTML_STRONG_OPEN

public static final HTMLTag HTML_STRONG_OPEN

HTML_UNDERLINE_OPEN

public static final HTMLTag HTML_UNDERLINE_OPEN

HTML_SUB_OPEN

public static final HTMLTag HTML_SUB_OPEN

HTML_SUP_OPEN

public static final HTMLTag HTML_SUP_OPEN

HTML_CENTER_OPEN

public static final HTMLTag HTML_CENTER_OPEN

HTML_TT_OPEN

public static final HTMLTag HTML_TT_OPEN

HTML_TABLE_OPEN

public static final HTMLTag HTML_TABLE_OPEN

HTML_CAPTION_OPEN

public static final HTMLTag HTML_CAPTION_OPEN

HTML_TH_OPEN

public static final HTMLTag HTML_TH_OPEN

HTML_TR_OPEN

public static final HTMLTag HTML_TR_OPEN

HTML_TD_OPEN

public static final HTMLTag HTML_TD_OPEN

HTML_UL_OPEN

public static final HTMLTag HTML_UL_OPEN

HTML_OL_OPEN

public static final HTMLTag HTML_OL_OPEN

HTML_LI_OPEN

public static final HTMLTag HTML_LI_OPEN

HTML_FONT_OPEN

public static final HTMLTag HTML_FONT_OPEN

HTML_CITE_OPEN

public static final HTMLTag HTML_CITE_OPEN

HTML_DIV_OPEN

public static final HTMLTag HTML_DIV_OPEN

HTML_DD_OPEN

public static final HTMLTag HTML_DD_OPEN

HTML_DL_OPEN

public static final HTMLTag HTML_DL_OPEN

HTML_DT_OPEN

public static final HTMLTag HTML_DT_OPEN

HTML_SPAN_OPEN

public static final HTMLTag HTML_SPAN_OPEN

HTML_VAR_OPEN

public static final HTMLTag HTML_VAR_OPEN

HTML_CODE_OPEN

public static final HTMLTag HTML_CODE_OPEN

HTML_S_OPEN

public static final HTMLTag HTML_S_OPEN

HTML_SMALL_OPEN

public static final HTMLTag HTML_SMALL_OPEN

HTML_BIG_OPEN

public static final HTMLTag HTML_BIG_OPEN

HTML_U_OPEN

public static final HTMLTag HTML_U_OPEN

HTML_DEL_OPEN

public static final HTMLTag HTML_DEL_OPEN

HTML_PRE_OPEN

public static final HTMLTag HTML_PRE_OPEN

TEMPLATE_CALLS_CACHE

public static java.util.Map<java.lang.String,java.lang.String> TEMPLATE_CALLS_CACHE

INTERWIKI_MAP

protected static final java.util.Map<java.lang.String,java.lang.String> INTERWIKI_MAP
Map from the interwiki shortcut to the real Interwiki-URL


TAG_TOKEN_MAP

protected static final java.util.HashMap<java.lang.String,TagToken> TAG_TOKEN_MAP
Map the HTML token string to the correspoding TagToken implementation


CODE_FORMATTER_MAP

protected static final java.util.HashMap<java.lang.String,SourceCodeFormatter> CODE_FORMATTER_MAP
Map the source code's language string to the code formatter implementation


TEMPLATE_FUNCTION_MAP

protected static final java.util.Map<java.lang.String,ITemplateFunction> TEMPLATE_FUNCTION_MAP
Map the template's function name to the TemplateFunction implementation


URI_SCHEME_MAP

protected static final java.util.Set<java.lang.String> URI_SCHEME_MAP
Allowed URI schemes


NOWIKI_OPEN_PATTERN

public static final java.util.regex.Pattern NOWIKI_OPEN_PATTERN

NOWIKI_CLOSE_PATTERN

public static final java.util.regex.Pattern NOWIKI_CLOSE_PATTERN

DEFAULT_CONFIGURATION

public static final Configuration DEFAULT_CONFIGURATION

PARSER_RECURSION_LIMIT

public static final int PARSER_RECURSION_LIMIT
Limits the recursive call of the Wikipedia and Template parser to a depth of PARSER_RECURSION_LIMIT

See Also:
Constant Field Values

RENDERER_RECURSION_LIMIT

public static final int RENDERER_RECURSION_LIMIT
Limits the recursive call of the HTMLConverter renderer to a depth of RENDERER_RECURSION_LIMIT

See Also:
Constant Field Values

TEMPLATE_RECURSION_LIMIT

public static final int TEMPLATE_RECURSION_LIMIT
Limits the recursive call of the Template parser to a depth of TEMPLATE_RECURSION_LIMIT

See Also:
Constant Field Values

TEMPLATE_BUFFER_LIMIT

public static final int TEMPLATE_BUFFER_LIMIT
Limits the Scanner buffer.

See Also:
Constant Field Values

TEMPLATE_VALUE_LIMIT

public static final int TEMPLATE_VALUE_LIMIT
Limits the template parameter value length

See Also:
Constant Field Values

GLOBAL_RECURSION_LIMIT

public static final int GLOBAL_RECURSION_LIMIT
Limits the recursive call of the AbstractParser parser to a depth of GLOBAL_RECURSION_LIMIT

See Also:
Constant Field Values
Constructor Detail

Configuration

public Configuration()
Method Detail

getInterwikiMap

public java.util.Map<java.lang.String,java.lang.String> getInterwikiMap()
Description copied from interface: IConfiguration
Get the interwiki links map for converting interwiki links into external URLs. Example: maps the interwiki shortcut "de" to "http://de.wikipedia.org/wiki/${title}"

Specified by:
getInterwikiMap in interface IConfiguration
Returns:

addInterwikiLink

public java.lang.String addInterwikiLink(java.lang.String key,
                                         java.lang.String value)
Description copied from interface: IConfiguration
Add another Interwiki link to the configuration. The value string must contain the ${title} placeholder for the used wiki article link.

Specified by:
addInterwikiLink in interface IConfiguration
Parameters:
key - the prefix used in the interwiki link (i.e. [[prefix:...]] )
value - the external link which should be generated from the interwiki link
Returns:

getUriSchemeSet

public java.util.Set<java.lang.String> getUriSchemeSet()
Get the set of all allowed URI scheme shortcuts like http, https, ftp,... See URI scheme

Specified by:
getUriSchemeSet in interface IConfiguration

addUriScheme

public boolean addUriScheme(java.lang.String uriKey)
Add an allowed URI scheme shortcut like http, https, ftp,... See URI scheme

Returns:
true if the set did not already contain the specified URI key.

containsUriScheme

public boolean containsUriScheme(java.lang.String uriKey)
Check if the URI scheme is allowed. See URI scheme

Returns:
true if the set contains the specified URI key.

getTemplateMap

public java.util.Map<java.lang.String,ITemplateFunction> getTemplateMap()
Description copied from interface: IConfiguration
Get the template parser functions map of built-in template functions

Specified by:
getTemplateMap in interface IConfiguration
Returns:

addTemplateFunction

public ITemplateFunction addTemplateFunction(java.lang.String key,
                                             ITemplateFunction value)
Description copied from interface: IConfiguration
Add a new interwiki link to the configuration

Specified by:
addTemplateFunction in interface IConfiguration
Returns:

getTemplateCallsCache

public java.util.Map<java.lang.String,java.lang.String> getTemplateCallsCache()
Get the currently configured cache implementation for template calls.

Specified by:
getTemplateCallsCache in interface IConfiguration
Returns:
null if no cache implementation is set.
See Also:
IConfiguration.setTemplateCallsCache(Map)

setTemplateCallsCache

public void setTemplateCallsCache(java.util.Map<java.lang.String,java.lang.String> map)
Set a cache map implementation. For example based on JSR 107. Template calls which use the same parameters over and over again do lookup this cache and use the preparsed result if available. Note: don't use a simple java.util.HashMap implementation because it's not thread-safe an grows infinitly.

Specified by:
setTemplateCallsCache in interface IConfiguration
Parameters:
map - the cache implementation

getCodeFormatterMap

public java.util.Map<java.lang.String,SourceCodeFormatter> getCodeFormatterMap()
Description copied from interface: IConfiguration
Get the source code formatter map of built-in source code formatters

Specified by:
getCodeFormatterMap in interface IConfiguration
Returns:

addCodeFormatter

public SourceCodeFormatter addCodeFormatter(java.lang.String key,
                                            SourceCodeFormatter value)
Description copied from interface: IConfiguration
Add a new source code formatter to the configuration

Specified by:
addCodeFormatter in interface IConfiguration
Returns:

getTokenMap

public java.util.Map<java.lang.String,TagToken> getTokenMap()
Description copied from interface: IConfiguration
Get the HTML styled tag map for built-in tags

Specified by:
getTokenMap in interface IConfiguration
Returns:

addTokenTag

public TagToken addTokenTag(java.lang.String key,
                            TagToken value)
Description copied from interface: IConfiguration
Add a new HTML styled tag to the configuration

Specified by:
addTokenTag in interface IConfiguration
Returns:


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