Class TableBlockParser
java.lang.Object
org.commonmark.parser.block.AbstractBlockParser
org.commonmark.ext.gfm.tables.internal.TableBlockParser
- All Implemented Interfaces:
BlockParser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TableBlock
private boolean
private final List
<TableBlockParser.TableCellInfo> private final List
<SourceLine> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
TableBlockParser
(List<TableBlockParser.TableCellInfo> columns, SourceLine headerLine) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLine
(SourceLine line) Add the part of a line that belongs to this block parser to parse (i.e.boolean
Return true if the block can have lazy continuation lines.private static TableCell.Alignment
getAlignment
(boolean left, boolean right) getBlock()
private TableCell
parseCell
(SourceLine cell, int column, InlineParser inlineParser) void
parseInlines
(InlineParser inlineParser) private static List
<TableBlockParser.TableCellInfo> private static List
<SourceLine> split
(SourceLine line) tryContinue
(ParserState state) Methods inherited from class org.commonmark.parser.block.AbstractBlockParser
addSourceSpan, canContain, closeBlock, getDefinitions, isContainer
-
Field Details
-
block
-
rowLines
-
columns
-
canHaveLazyContinuationLines
private boolean canHaveLazyContinuationLines
-
-
Constructor Details
-
TableBlockParser
-
-
Method Details
-
canHaveLazyContinuationLines
public boolean canHaveLazyContinuationLines()Description copied from interface:BlockParser
Return true if the block can have lazy continuation lines.Lazy continuation lines are lines that were rejected by this
BlockParser.tryContinue(ParserState)
but didn't match any other block parsers either.If true is returned here, those lines will get added via
BlockParser.addLine(SourceLine)
. For false, the block is closed instead.- Specified by:
canHaveLazyContinuationLines
in interfaceBlockParser
- Overrides:
canHaveLazyContinuationLines
in classAbstractBlockParser
-
getBlock
-
tryContinue
-
addLine
Description copied from interface:BlockParser
Add the part of a line that belongs to this block parser to parse (i.e. without any container block markers). Note that the line will only include aSourceLine.getSourceSpan()
if source spans are enabled for inlines.- Specified by:
addLine
in interfaceBlockParser
- Overrides:
addLine
in classAbstractBlockParser
-
parseInlines
- Specified by:
parseInlines
in interfaceBlockParser
- Overrides:
parseInlines
in classAbstractBlockParser
-
parseCell
-
split
-
parseSeparator
-
getAlignment
-