public class FormatedTextParser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static FormatBlockFactory |
BOLD_FACTORY
creates bold blocks
|
private static FormatBlockFactory |
BOLDITALIC_FACTORY
creates bold italic blocks
|
private static FormatBlockFactory |
BOLDMONO_FACTORY
creates bold monospace blocks
|
private static java.util.Map<java.lang.String,FormatBlockFactory> |
FACTORY_MAP
map used to create blocks dependening on the text format
|
private static FormatBlockFactory |
ITALIC_FACTORY
creates italic blocks
|
private static FormatBlockFactory |
MONOSPACED_FACTORY
creates monospaced blocks
|
private static java.lang.String[] |
SPECIAL_CHAR
format characters
|
private TextParser |
textParser
parser used to parse text...
|
Constructor and Description |
---|
FormatedTextParser() |
Modifier and Type | Method and Description |
---|---|
private boolean |
isParenthesis(char c) |
(package private) static boolean |
isSpace(char c) |
(package private) static boolean |
isSpecial(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...)
TODO too many lines!!
|
void |
setTextParser(TextParser textParser)
Sets the formatTextParser.
|
private TextParser textParser
private static final java.util.Map<java.lang.String,FormatBlockFactory> FACTORY_MAP
private static final FormatBlockFactory BOLD_FACTORY
private static final FormatBlockFactory ITALIC_FACTORY
private static final FormatBlockFactory MONOSPACED_FACTORY
private static final FormatBlockFactory BOLDITALIC_FACTORY
private static final FormatBlockFactory BOLDMONO_FACTORY
private static final java.lang.String[] SPECIAL_CHAR
final Block[] parse(java.lang.String line)
line
- line to parsestatic boolean isSpace(char c)
c
- character to testtrue
if c is a space characterstatic boolean isSpecial(char c)
c
- character to testtrue
if c is a character that limits the formatsprivate java.util.List<Block> parseFormat(java.lang.String line)
line
- line to parseprivate boolean isParenthesis(char c)
c
- character to testtrue
if c is a parenthesispublic final void setTextParser(TextParser textParser)
textParser
- text parser to use
TextParser
with the formatTextParser.