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 class
ListBlockParser.Factory
private static class
ListBlockParser.ListData
private static class
ListBlockParser.ListMarkerData
-
Field Summary
Fields Modifier and Type Field Description private ListBlock
block
private boolean
hadBlankLine
private int
linesAfterBlank
-
Constructor Summary
Constructors Constructor Description ListBlockParser(ListBlock block)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canContain(Block childBlock)
Block
getBlock()
boolean
isContainer()
Return true if the block that is parsed is a container (contains other blocks), or false if it's a leaf.private static boolean
isSpaceTabOrEnd(java.lang.CharSequence line, int index)
private static boolean
listsMatch(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.ListData
parseList(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.ListMarkerData
parseListMarker(java.lang.CharSequence line, int index)
private static ListBlockParser.ListMarkerData
parseOrderedList(java.lang.CharSequence line, int index)
BlockContinue
tryContinue(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:BlockParser
Return true if the block that is parsed is a container (contains other blocks), or false if it's a leaf.- Specified by:
isContainer
in interfaceBlockParser
- Overrides:
isContainer
in classAbstractBlockParser
-
canContain
public boolean canContain(Block childBlock)
- Specified by:
canContain
in interfaceBlockParser
- Overrides:
canContain
in 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)
-
-