Package org.commonmark.internal
Class ListBlockParser
- java.lang.Object
-
- org.commonmark.parser.block.AbstractBlockParser
-
- org.commonmark.internal.ListBlockParser
-
- All Implemented Interfaces:
BlockParser
public class ListBlockParser extends AbstractBlockParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classListBlockParser.Factoryprivate static classListBlockParser.ListDataprivate static classListBlockParser.ListMarkerData
-
Field Summary
Fields Modifier and Type Field Description private ListBlockblockprivate booleanhadBlankLineprivate intlinesAfterBlank
-
Constructor Summary
Constructors Constructor Description ListBlockParser(ListBlock block)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanContain(Block childBlock)BlockgetBlock()booleanisContainer()Return true if the block that is parsed is a container (contains other blocks), or false if it's a leaf.private static booleanisSpaceTabOrEnd(java.lang.CharSequence line, int index)private static booleanlistsMatch(ListBlock a, ListBlock b)Returns true if the two list items are of the same type, with the same delimiter and bullet character.private static ListBlockParser.ListDataparseList(java.lang.CharSequence line, int markerIndex, int markerColumn, boolean inParagraph)Parse a list marker and return data on the marker or null.private static ListBlockParser.ListMarkerDataparseListMarker(java.lang.CharSequence line, int index)private static ListBlockParser.ListMarkerDataparseOrderedList(java.lang.CharSequence line, int index)BlockContinuetryContinue(ParserState state)-
Methods inherited from class org.commonmark.parser.block.AbstractBlockParser
addLine, addSourceSpan, canHaveLazyContinuationLines, closeBlock, getDefinitions, parseInlines
-
-
-
-
Field Detail
-
block
private final ListBlock block
-
hadBlankLine
private boolean hadBlankLine
-
linesAfterBlank
private int linesAfterBlank
-
-
Constructor Detail
-
ListBlockParser
public ListBlockParser(ListBlock block)
-
-
Method Detail
-
isContainer
public boolean isContainer()
Description copied from interface:BlockParserReturn true if the block that is parsed is a container (contains other blocks), or false if it's a leaf.- Specified by:
isContainerin interfaceBlockParser- Overrides:
isContainerin classAbstractBlockParser
-
canContain
public boolean canContain(Block childBlock)
- Specified by:
canContainin interfaceBlockParser- Overrides:
canContainin classAbstractBlockParser
-
getBlock
public Block getBlock()
-
tryContinue
public BlockContinue tryContinue(ParserState state)
-
parseList
private static ListBlockParser.ListData parseList(java.lang.CharSequence line, int markerIndex, int markerColumn, boolean inParagraph)
Parse a list marker and return data on the marker or null.
-
parseListMarker
private static ListBlockParser.ListMarkerData parseListMarker(java.lang.CharSequence line, int index)
-
parseOrderedList
private static ListBlockParser.ListMarkerData parseOrderedList(java.lang.CharSequence line, int index)
-
isSpaceTabOrEnd
private static boolean isSpaceTabOrEnd(java.lang.CharSequence line, int index)
-
-