Class ParagraphBlockParser

java.lang.Object
org.apache.maven.doxia.module.confluence.parser.ParagraphBlockParser
All Implemented Interfaces:
BlockParser

public class ParagraphBlockParser extends Object implements BlockParser

ParagraphBlockParser class.

  • Field Details

  • Constructor Details

    • ParagraphBlockParser

      public ParagraphBlockParser(BlockParser[] parsers)

      Constructor for ParagraphBlockParser.

      Parameters:
      parsers - the parsers.
  • Method Details

    • accept

      public boolean accept(String line, ByLineSource source)
      accept.
      Specified by:
      accept in interface BlockParser
      Parameters:
      line - the line.
      source - the source.
      Returns:
      boolean true if valid.
    • visit

      public Block visit(String line, ByLineSource source, boolean generateParagraphTags) throws ParseException
      Visit the Block.
      Parameters:
      line - the line to visit.
      source - the source.
      generateParagraphTags - whether to generate a paragraph.
      Returns:
      the visited Block.
      Throws:
      ParseException - if any.
    • visit

      public Block visit(String line, ByLineSource source) throws ParseException
      visit.
      Specified by:
      visit in interface BlockParser
      Parameters:
      line - the line.
      source - the source.
      Returns:
      boolean true if valid.
      Throws:
      ParseException - if any.
    • appendUntilEmptyLine

      private String appendUntilEmptyLine(String line, ByLineSource source) throws ParseException
      Slurp lines from the source starting with the given line appending them together into a StringBuilder until an empty line is reached, and while the source contains more lines. The result can be passed to the #getBlocks(String) method.
      Parameters:
      line - the first line
      source - the source to read new lines from
      Returns:
      a StringBuilder appended with lines
      Throws:
      ParseException