@Component(role=Parser.class, hint="twiki") public class TWikiParser extends AbstractTextParser
Modifier and Type | Field and Description |
---|---|
private static int |
EXTENSION_LENGTH |
private FormatedTextParser |
formatTextParser
Text parser.
|
private HRuleBlockParser |
hrulerParser
hruler parser.
|
private GenericListBlockParser |
listParser
enumeration parser.
|
private ParagraphBlockParser |
paraParser
paragraph parser.
|
private BlockParser[] |
parsers
list of parsers to try to apply to the toplevel
|
private SectionBlockParser |
sectionParser
section parser.
|
private TableBlockParser |
tableParser
table parser.
|
private TextParser |
textParser
text parser.
|
private VerbatimBlockParser |
verbatimParser
verbatim parser.
|
PIPE
COLON, EOL, EQUAL, GREATER_THAN, LEFT_CURLY_BRACKET, LEFT_SQUARE_BRACKET, LESS_THAN, MINUS, PLUS, QUOTE, RIGHT_CURLY_BRACKET, RIGHT_SQUARE_BRACKET, SEMICOLON, SLASH, SPACE, STAR
ROLE, TXT_TYPE, UNKNOWN_TYPE, XML_TYPE
Constructor and Description |
---|
TWikiParser()
Creates the TWikiParser.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getTitle(java.util.List<Block> blocks,
ByLineSource source)
Guess a title for the page.
|
protected void |
init()
Initialize the parser.
|
java.util.List<Block> |
parse(ByLineSource source)
parse.
|
void |
parse(java.io.Reader source,
Sink sink)
Parses the given source model and emits Doxia events into the given sink.
|
void |
parse(java.io.Reader source,
Sink sink,
java.lang.String reference)
Parses the given source model and emits Doxia events into the given sink.
|
getType
doxiaVersion, enableLogging, executeMacro, getBasedir, getLog, getMacroManager, isEmitComments, isSecondParsing, parse, setEmitComments, setSecondParsing
private static final int EXTENSION_LENGTH
private final ParagraphBlockParser paraParser
private final SectionBlockParser sectionParser
private final GenericListBlockParser listParser
private final FormatedTextParser formatTextParser
private final TextParser textParser
private final HRuleBlockParser hrulerParser
private final TableBlockParser tableParser
private final VerbatimBlockParser verbatimParser
private BlockParser[] parsers
public final java.util.List<Block> parse(ByLineSource source) throws ParseException
parse.
source
- source to parse.ParseException
- on error.public void parse(java.io.Reader source, Sink sink) throws ParseException
Parser
source
- not null reader that provides the source document.
You could use newReader
methods from ReaderFactory
.sink
- A sink that consumes the Doxia events.ParseException
- if the model could not be parsed.public final void parse(java.io.Reader source, Sink sink, java.lang.String reference) throws ParseException
Parser
parse
in interface Parser
parse
in class AbstractParser
source
- not null reader that provides the source document.
You could use newReader
methods from ReaderFactory
.sink
- A sink that consumes the Doxia events.ParseException
- if the model could not be parsed.public final java.lang.String getTitle(java.util.List<Block> blocks, ByLineSource source)
ByLineReaderSource.getName()
blocks
- blocks to parsesource
- source to parseprotected void init()
Parser.parse(java.io.Reader, org.apache.maven.doxia.sink.Sink)
and can be used
to set the parser into a clear state so it can be re-used.init
in class AbstractParser