Class TWikiParser

All Implemented Interfaces:
LogEnabled, Markup, TextMarkup, Parser

@Component(role=Parser.class, hint="twiki") public class TWikiParser extends AbstractTextParser
Since:
1.0
  • Field Details

    • EXTENSION_LENGTH

      private static final int EXTENSION_LENGTH
      See Also:
    • paraParser

      private final ParagraphBlockParser paraParser
      paragraph parser.
    • sectionParser

      private final SectionBlockParser sectionParser
      section parser.
    • listParser

      private final GenericListBlockParser listParser
      enumeration parser.
    • formatTextParser

      private final FormatedTextParser formatTextParser
      Text parser.
    • textParser

      private final TextParser textParser
      text parser. This only works for xhtml output, but there is no way of transforming a wikiWord in another context.
    • hrulerParser

      private final HRuleBlockParser hrulerParser
      hruler parser.
    • tableParser

      private final TableBlockParser tableParser
      table parser.
    • verbatimParser

      private final VerbatimBlockParser verbatimParser
      verbatim parser.
    • parsers

      private BlockParser[] parsers
      list of parsers to try to apply to the toplevel
  • Constructor Details

    • TWikiParser

      public TWikiParser()
      Creates the TWikiParser.
  • Method Details

    • parse

      public final List<Block> parse(ByLineSource source) throws ParseException

      parse.

      Parameters:
      source - source to parse.
      Returns:
      the blocks that represent source.
      Throws:
      ParseException - on error.
    • parse

      public void parse(Reader source, Sink sink) throws ParseException
      Parses the given source model and emits Doxia events into the given sink.
      Specified by:
      parse in interface Parser
      Overrides:
      parse in class AbstractParser
      Parameters:
      source - not null reader that provides the source document. You could use newReader methods from ReaderFactory.
      sink - A sink that consumes the Doxia events.
      Throws:
      ParseException - if the model could not be parsed.
    • parse

      public final void parse(Reader source, Sink sink, String reference) throws ParseException
      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 use newReader methods from ReaderFactory.
      sink - A sink that consumes the Doxia events.
      reference - the reference
      Throws:
      ParseException - if the model could not be parsed.
    • getTitle

      public final String getTitle(List<Block> blocks, ByLineSource source)
      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 from ByLineReaderSource.getName()
      Parameters:
      blocks - blocks to parse
      source - source to parse
      Returns:
      a title for a page
      Since:
      1.1
    • init

      protected void init()
      Initialize the parser. This is called first by AbstractParser.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:
      init in class AbstractParser