org.kefirsf.bb.proc
Class BBProcessor

java.lang.Object
  extended by org.kefirsf.bb.TextProcessorAdapter
      extended by org.kefirsf.bb.proc.BBProcessor
All Implemented Interfaces:
TextProcessor

public final class BBProcessor
extends TextProcessorAdapter

The bbcode processor. You can use the standard code set or define other.

Author:
Kefir

Constructor Summary
BBProcessor()
          Create the bbcode processor
 
Method Summary
 CharSequence process(CharSequence source)
          Process bbcodes
1.
 void setConstants(Set<PatternConstant> constants)
           
 void setNestingLimit(int nestingLimit)
           
 void setParams(Map<String,Object> params)
          Set text processor parameters map.
 void setPrefix(ProcTemplate prefix)
          Set the prefix for text processor
 void setPropagateNestingException(boolean propagateNestingException)
           
 void setScope(ProcScope scope)
          Set the root scope of text processor.
 void setSuffix(ProcTemplate suffix)
          Set the suffix for text processor
 
Methods inherited from class org.kefirsf.bb.TextProcessorAdapter
process, process, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BBProcessor

public BBProcessor()
Create the bbcode processor

Method Detail

process

public CharSequence process(CharSequence source)
Process bbcodes
1. Escape the xml special symbols
2. replace bbcodes to HTML-tags
3. replace symbols \r\n to HTML-tag "<br/>"

Parameters:
source - the source string
Returns:
result string
See Also:
TextProcessor.process(CharSequence)

setScope

public void setScope(ProcScope scope)
              throws IllegalStateException
Set the root scope of text processor.

Parameters:
scope - root code scope
Throws:
IllegalStateException - if scope already setted

setPrefix

public void setPrefix(ProcTemplate prefix)
               throws IllegalStateException
Set the prefix for text processor

Parameters:
prefix - template wich uses to create prefix
Throws:
IllegalStateException - If prefix already setted

setSuffix

public void setSuffix(ProcTemplate suffix)
Set the suffix for text processor

Parameters:
suffix - template wich uses to create prefix
Throws:
IllegalStateException - If suffix already setted

setParams

public void setParams(Map<String,Object> params)
Set text processor parameters map.

Parameters:
params - parameters

setConstants

public void setConstants(Set<PatternConstant> constants)

setNestingLimit

public void setNestingLimit(int nestingLimit)

setPropagateNestingException

public void setPropagateNestingException(boolean propagateNestingException)


Copyright © 2013. All Rights Reserved.