Class ParagraphBlockParser
- java.lang.Object
-
- org.apache.maven.doxia.module.confluence.parser.ParagraphBlockParser
-
- All Implemented Interfaces:
BlockParser
public class ParagraphBlockParser extends java.lang.Object implements BlockParser
ParagraphBlockParser class.
-
-
Field Summary
Fields Modifier and Type Field Description private BlockParser[]parsers
-
Constructor Summary
Constructors Constructor Description ParagraphBlockParser(BlockParser[] parsers)Constructor for ParagraphBlockParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(java.lang.String line, ByLineSource source)accept.private java.lang.StringappendUntilEmptyLine(java.lang.String line, ByLineSource source)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.Blockvisit(java.lang.String line, ByLineSource source)visit.Blockvisit(java.lang.String line, ByLineSource source, boolean generateParagraphTags)Visit the Block.
-
-
-
Field Detail
-
parsers
private BlockParser[] parsers
-
-
Constructor Detail
-
ParagraphBlockParser
public ParagraphBlockParser(BlockParser[] parsers)
Constructor for ParagraphBlockParser.
- Parameters:
parsers- the parsers.
-
-
Method Detail
-
accept
public boolean accept(java.lang.String line, ByLineSource source)accept.- Specified by:
acceptin interfaceBlockParser- Parameters:
line- the line.source- the source.- Returns:
- boolean true if valid.
-
visit
public Block visit(java.lang.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(java.lang.String line, ByLineSource source) throws ParseException
visit.- Specified by:
visitin interfaceBlockParser- Parameters:
line- the line.source- the source.- Returns:
- boolean true if valid.
- Throws:
ParseException- if any.
-
appendUntilEmptyLine
private java.lang.String appendUntilEmptyLine(java.lang.String line, ByLineSource source) throws ParseExceptionSlurp 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 linesource- the source to read new lines from- Returns:
- a StringBuilder appended with lines
- Throws:
ParseException
-
-