Class TWikiParser
java.lang.Object
org.apache.maven.doxia.parser.AbstractParser
org.apache.maven.doxia.parser.AbstractTextParser
org.apache.maven.doxia.module.twiki.TWikiParser
- All Implemented Interfaces:
LogEnabled,Markup,TextMarkup,Parser
Parse the
twiki file format
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final FormatedTextParserText parser.private final HRuleBlockParserhruler parser.private final GenericListBlockParserenumeration parser.private final ParagraphBlockParserparagraph parser.private BlockParser[]list of parsers to try to apply to the toplevelprivate final SectionBlockParsersection parser.private final TableBlockParsertable parser.private final TextParsertext parser.private final VerbatimBlockParserverbatim parser.Fields inherited from interface org.apache.maven.doxia.markup.Markup
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, STARFields inherited from interface org.apache.maven.doxia.parser.Parser
ROLE, TXT_TYPE, UNKNOWN_TYPE, XML_TYPEFields inherited from interface org.apache.maven.doxia.markup.TextMarkup
PIPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetTitle(List<Block> blocks, ByLineSource source) Guess a title for the page.protected voidinit()Initialize the parser.voidParses the given source model and emits Doxia events into the given sink.final voidParses the given source model and emits Doxia events into the given sink.parse(ByLineSource source) parse.Methods inherited from class org.apache.maven.doxia.parser.AbstractTextParser
getTypeMethods inherited from class org.apache.maven.doxia.parser.AbstractParser
doxiaVersion, enableLogging, executeMacro, getBasedir, getLog, getMacroManager, isEmitComments, isSecondParsing, parse, parse, setEmitComments, setSecondParsing
-
Field Details
-
EXTENSION_LENGTH
private static final int EXTENSION_LENGTH- See Also:
-
paraParser
paragraph parser. -
sectionParser
section parser. -
listParser
enumeration parser. -
formatTextParser
Text parser. -
textParser
text parser. This only works for xhtml output, but there is no way of transforming a wikiWord in another context. -
hrulerParser
hruler parser. -
tableParser
table parser. -
verbatimParser
verbatim parser. -
parsers
list of parsers to try to apply to the toplevel
-
-
Constructor Details
-
TWikiParser
public TWikiParser()Creates the TWikiParser.
-
-
Method Details
-
parse
parse.
- Parameters:
source- source to parse.- Returns:
- the blocks that represent source.
- Throws:
ParseException- on error.
-
parse
Parses the given source model and emits Doxia events into the given sink.- Specified by:
parsein interfaceParser- Overrides:
parsein classAbstractParser- Parameters:
source- not null reader that provides the source document. You could usenewReadermethods fromReaderFactory.sink- A sink that consumes the Doxia events.- Throws:
ParseException- if the model could not be parsed.
-
parse
Parses the given source model and emits Doxia events into the given sink.- Parameters:
source- not null reader that provides the source document. You could usenewReadermethods fromReaderFactory.sink- A sink that consumes the Doxia events.reference- the reference- Throws:
ParseException- if the model could not be parsed.
-
getTitle
Guess a title for the page. It uses the first section that it finds. If it doesn't find any section tries to get it fromByLineReaderSource.getName()- Parameters:
blocks- blocks to parsesource- source to parse- Returns:
- a title for a page
- Since:
- 1.1
-
init
protected void init()Initialize the parser. This is called first byAbstractParser.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.- Overrides:
initin classAbstractParser
-