Class FormatedTextParser
java.lang.Object
org.apache.maven.doxia.module.twiki.parser.FormatedTextParser
Parse looking for formated text (bold, italic, ...)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final FormatBlockFactorycreates bold blocksprivate static final FormatBlockFactorycreates bold italic blocksprivate static final FormatBlockFactorycreates bold monospace blocksprivate static final Map<String, FormatBlockFactory> map used to create blocks dependening on the text formatprivate static final FormatBlockFactorycreates italic blocksprivate static final FormatBlockFactorycreates monospaced blocksprivate static final String[]format charactersprivate TextParserparser used to parse text... -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanisParenthesis(char c) (package private) static booleanisSpace(char c) (package private) static booleanisSpecial(char c) (package private) final Block[]parseFormat(String line) Parse text format (bold, italic...)final voidsetTextParser(TextParser textParser) Sets the formatTextParser.
-
Field Details
-
textParser
parser used to parse text... -
FACTORY_MAP
map used to create blocks dependening on the text format -
BOLD_FACTORY
creates bold blocks -
ITALIC_FACTORY
creates italic blocks -
MONOSPACED_FACTORY
creates monospaced blocks -
BOLDITALIC_FACTORY
creates bold italic blocks -
BOLDMONO_FACTORY
creates bold monospace blocks -
SPECIAL_CHAR
format characters
-
-
Constructor Details
-
FormatedTextParser
public FormatedTextParser()
-
-
Method Details
-
parse
- 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
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
Sets the formatTextParser.- Parameters:
textParser- text parser to useTextParserwith the formatTextParser.
-