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 FormatBlockFactory
creates bold blocksprivate static final FormatBlockFactory
creates bold italic blocksprivate static final FormatBlockFactory
creates bold monospace blocksprivate static final Map<String,
FormatBlockFactory> map used to create blocks dependening on the text formatprivate static final FormatBlockFactory
creates italic blocksprivate static final FormatBlockFactory
creates monospaced blocksprivate static final String[]
format charactersprivate TextParser
parser used to parse text... -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
isParenthesis
(char c) (package private) static boolean
isSpace
(char c) (package private) static boolean
isSpecial
(char c) (package private) final Block[]
parseFormat
(String line) Parse text format (bold, italic...)final void
setTextParser
(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:
true
if c is a space character
-
isSpecial
static boolean isSpecial(char c) - Parameters:
c
- character to test- Returns:
true
if 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:
true
if c is a parenthesis
-
setTextParser
Sets the formatTextParser.- Parameters:
textParser
- text parser to useTextParser
with the formatTextParser.
-