Class FormatedTextParser
- java.lang.Object
-
- org.apache.maven.doxia.module.twiki.parser.FormatedTextParser
-
public class FormatedTextParser extends java.lang.ObjectParse looking for formated text (bold, italic, ...)- Version:
- $Id$
-
-
Field Summary
Fields Modifier and Type Field Description private static FormatBlockFactoryBOLD_FACTORYcreates bold blocksprivate static FormatBlockFactoryBOLDITALIC_FACTORYcreates bold italic blocksprivate static FormatBlockFactoryBOLDMONO_FACTORYcreates bold monospace blocksprivate static java.util.Map<java.lang.String,FormatBlockFactory>FACTORY_MAPmap used to create blocks dependening on the text formatprivate static FormatBlockFactoryITALIC_FACTORYcreates italic blocksprivate static FormatBlockFactoryMONOSPACED_FACTORYcreates monospaced blocksprivate static java.lang.String[]SPECIAL_CHARformat charactersprivate TextParsertextParserparser used to parse text...
-
Constructor Summary
Constructors Constructor Description FormatedTextParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanisParenthesis(char c)(package private) static booleanisSpace(char c)(package private) static booleanisSpecial(char c)(package private) Block[]parse(java.lang.String line)private java.util.List<Block>parseFormat(java.lang.String line)Parse text format (bold, italic...)voidsetTextParser(TextParser textParser)Sets the formatTextParser.
-
-
-
Field Detail
-
textParser
private TextParser textParser
parser used to parse text...
-
FACTORY_MAP
private static final java.util.Map<java.lang.String,FormatBlockFactory> FACTORY_MAP
map used to create blocks dependening on the text format
-
BOLD_FACTORY
private static final FormatBlockFactory BOLD_FACTORY
creates bold blocks
-
ITALIC_FACTORY
private static final FormatBlockFactory ITALIC_FACTORY
creates italic blocks
-
MONOSPACED_FACTORY
private static final FormatBlockFactory MONOSPACED_FACTORY
creates monospaced blocks
-
BOLDITALIC_FACTORY
private static final FormatBlockFactory BOLDITALIC_FACTORY
creates bold italic blocks
-
BOLDMONO_FACTORY
private static final FormatBlockFactory BOLDMONO_FACTORY
creates bold monospace blocks
-
SPECIAL_CHAR
private static final java.lang.String[] SPECIAL_CHAR
format characters
-
-
Method Detail
-
parse
final Block[] parse(java.lang.String line)
- Parameters:
line- line to parse- Returns:
- TextBlock, ItalicBlock, BoldBlock, MonospacedBlock, ...
-
isSpace
static boolean isSpace(char c)
- Parameters:
c- character to test- Returns:
trueif c is a space character
-
isSpecial
static boolean isSpecial(char c)
- Parameters:
c- character to test- Returns:
trueif c is a character that limits the formats
-
parseFormat
private java.util.List<Block> parseFormat(java.lang.String line)
Parse text format (bold, italic...) TODO too many lines!!- Parameters:
line- line to parse- Returns:
- list of blocks
-
isParenthesis
private boolean isParenthesis(char c)
- Parameters:
c- character to test- Returns:
trueif c is a parenthesis
-
setTextParser
public final void setTextParser(TextParser textParser)
Sets the formatTextParser.- Parameters:
textParser- text parser to useTextParserwith the formatTextParser.
-
-