org.kefirsf.bb.conf
Class Configuration

java.lang.Object
  extended by org.kefirsf.bb.conf.Configuration

public class Configuration
extends Object

Configuration of bbcode processor.

Author:
Vitaliy Samolovskih aka Kefir

Field Summary
static int DEFAULT_NESTING_LIMIT
          Default nesting limit for processor.
static boolean DEFAULT_PROPAGATE_NESTING_EXCEPTION
          By default the processor don't throw an exception if nesting limit exceeded.
 
Constructor Summary
Configuration()
          Create the configuration
 
Method Summary
 int getNestingLimit()
          Get nesting limit.
 Map<String,Object> getParams()
          Get predefined parameters.
 Template getPrefix()
          Get prefix.
 Scope getRootScope()
          Get root scope
 Template getSuffix()
          Get suffix.
 boolean isPropagateNestingException()
          Get nesting exceeded behavior.
 void setNestingLimit(int nestingLimit)
          Set nesting limit.
 void setParams(Map<String,Object> params)
          Set parameters to configuration.
 void setPrefix(Template prefix)
          Set prefix template.
 void setPropagateNestingException(boolean propagateNestingException)
          Define nesting exceeded behavior.
 void setRootScope(Scope rootScope)
          Set root scope for configuration.
 void setSuffix(Template suffix)
          Set suffix template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NESTING_LIMIT

public static final int DEFAULT_NESTING_LIMIT
Default nesting limit for processor. How many codes can be nested.

See Also:
Constant Field Values

DEFAULT_PROPAGATE_NESTING_EXCEPTION

public static final boolean DEFAULT_PROPAGATE_NESTING_EXCEPTION
By default the processor don't throw an exception if nesting limit exceeded. But the user can override this behavior.

See Also:
Constant Field Values
Constructor Detail

Configuration

public Configuration()
Create the configuration

Method Detail

getRootScope

public Scope getRootScope()
Get root scope

Returns:
root scope

setRootScope

public void setRootScope(Scope rootScope)
Set root scope for configuration.

Parameters:
rootScope - scope

getPrefix

public Template getPrefix()
Get prefix.

Returns:
template for prefix

setPrefix

public void setPrefix(Template prefix)
Set prefix template. Prefix append to start of processed text.

Parameters:
prefix - template for prefix

getSuffix

public Template getSuffix()
Get suffix.

Returns:
template for suffix

setSuffix

public void setSuffix(Template suffix)
Set suffix template. Suffix append to end of processed text.

Parameters:
suffix - template for suffix

getParams

public Map<String,Object> getParams()
Get predefined parameters. They can be used in var tags.

Returns:
map of parameters

setParams

public void setParams(Map<String,Object> params)
Set parameters to configuration.

Parameters:
params - the map with parameters. Key is a parameter name.

getNestingLimit

public int getNestingLimit()
Get nesting limit. How many codes can be nested.

Returns:
nesting limit

setNestingLimit

public void setNestingLimit(int nestingLimit)
Set nesting limit. How many codes can be nested.

Parameters:
nestingLimit - nesting limit

isPropagateNestingException

public boolean isPropagateNestingException()
Get nesting exceeded behavior.

Returns:
true if the processor will throw an exception when nesting limit is exceeded. false if the processor will not throw an exception and return blank text.

setPropagateNestingException

public void setPropagateNestingException(boolean propagateNestingException)
Define nesting exceeded behavior.

Parameters:
propagateNestingException - throw or not exception


Copyright © 2013. All Rights Reserved.