Package com.vladsch.flexmark.parser.core
Class ListBlockParser
- java.lang.Object
-
- com.vladsch.flexmark.parser.block.AbstractBlockParser
-
- com.vladsch.flexmark.parser.core.ListBlockParser
-
- All Implemented Interfaces:
BlockParser
public class ListBlockParser extends AbstractBlockParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ListBlockParser.BlockFactory
static class
ListBlockParser.Factory
(package private) static class
ListBlockParser.ListData
(package private) static class
ListBlockParser.ListItemLeadInHandler
-
Field Summary
Fields Modifier and Type Field Description private ListBlock
myBlock
(package private) BasedSequence
myItemHandledLine
(package private) boolean
myItemHandledNewItemLine
(package private) boolean
myItemHandledNewListLine
(package private) boolean
myItemHandledSkipActiveLine
(package private) ListItemParser
myLastChild
private ListBlockParser.ListData
myListData
private ListOptions
myOptions
-
Constructor Summary
Constructors Constructor Description ListBlockParser(ListOptions options, ListBlockParser.ListData listData, ListItemParser listItemParser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
breakOutOnDoubleBlankLine()
boolean
canContain(ParserState state, BlockParser blockParser, Block block)
void
closeBlock(ParserState state)
private static ListBlock
createListBlock(java.util.regex.Matcher matcher)
private void
finalizeListTight(ParserState parserState)
ListBlock
getBlock()
(package private) int
getContentIndent()
(package private) BasedSequence
getItemHandledLine()
ListItemParser
getLastChild()
(package private) int
getLastContentIndent()
ListBlockParser.ListData
getListData()
ListOptions
getOptions()
private static boolean
hasNonItemChildren(ListItem item)
boolean
isContainer()
(package private) static ListBlockParser.ListData
parseListMarker(ListOptions options, int newItemCodeIndent, ParserState state)
Parse a list marker and return data on the marker or null.(package private) void
setItemHandledLine(BasedSequence itemHandledLine)
(package private) void
setItemHandledLineSkipActive(BasedSequence itemHandledLine)
(package private) void
setItemHandledNewItemLine(BasedSequence itemHandledLine)
(package private) void
setItemHandledNewListLine(BasedSequence itemHandledLine)
void
setLastChild(ListItemParser lastChild)
private void
setTight(boolean tight)
BlockContinue
tryContinue(ParserState state)
See if the block parser can continue parsing the current block-
Methods inherited from class com.vladsch.flexmark.parser.block.AbstractBlockParser
addLine, canInterruptBy, finalizeClosedBlock, getBlockContent, getDataHolder, isClosed, isInterruptible, isParagraphParser, isPropagatingLastBlankLine, isRawText, parseInlines, removeBlankLines
-
-
-
-
Field Detail
-
myBlock
private final ListBlock myBlock
-
myOptions
private final ListOptions myOptions
-
myListData
private final ListBlockParser.ListData myListData
-
myLastChild
ListItemParser myLastChild
-
myItemHandledLine
BasedSequence myItemHandledLine
-
myItemHandledNewListLine
boolean myItemHandledNewListLine
-
myItemHandledNewItemLine
boolean myItemHandledNewItemLine
-
myItemHandledSkipActiveLine
boolean myItemHandledSkipActiveLine
-
-
Constructor Detail
-
ListBlockParser
public ListBlockParser(ListOptions options, ListBlockParser.ListData listData, ListItemParser listItemParser)
-
-
Method Detail
-
getItemHandledLine
BasedSequence getItemHandledLine()
-
setItemHandledLine
void setItemHandledLine(BasedSequence itemHandledLine)
-
setItemHandledNewListLine
void setItemHandledNewListLine(BasedSequence itemHandledLine)
-
setItemHandledNewItemLine
void setItemHandledNewItemLine(BasedSequence itemHandledLine)
-
setItemHandledLineSkipActive
void setItemHandledLineSkipActive(BasedSequence itemHandledLine)
-
getLastChild
public ListItemParser getLastChild()
-
setLastChild
public void setLastChild(ListItemParser lastChild)
-
getOptions
public ListOptions getOptions()
-
getListData
public ListBlockParser.ListData getListData()
-
getContentIndent
int getContentIndent()
-
getLastContentIndent
int getLastContentIndent()
-
isContainer
public boolean isContainer()
- Specified by:
isContainer
in interfaceBlockParser
- Overrides:
isContainer
in classAbstractBlockParser
- Returns:
- true if the block that is parsed is a container (contains other blocks), or false if it's a leaf.
-
canContain
public boolean canContain(ParserState state, BlockParser blockParser, Block block)
- Specified by:
canContain
in interfaceBlockParser
- Overrides:
canContain
in classAbstractBlockParser
- Parameters:
state
- parser stateblockParser
- block parserblock
- new block being started @return true if this block parser's block can contain the given block type, false if it cannot
-
getBlock
public ListBlock getBlock()
- Returns:
- the block parser's block node instance
-
setTight
private void setTight(boolean tight)
-
closeBlock
public void closeBlock(ParserState state)
-
breakOutOnDoubleBlankLine
public boolean breakOutOnDoubleBlankLine()
- Specified by:
breakOutOnDoubleBlankLine
in interfaceBlockParser
- Overrides:
breakOutOnDoubleBlankLine
in classAbstractBlockParser
- Returns:
- true if Double blank line should finalize this block parser and its children and reset to parent
-
hasNonItemChildren
private static boolean hasNonItemChildren(ListItem item)
-
finalizeListTight
private void finalizeListTight(ParserState parserState)
-
parseListMarker
static ListBlockParser.ListData parseListMarker(ListOptions options, int newItemCodeIndent, ParserState state)
Parse a list marker and return data on the marker or null.
-
createListBlock
private static ListBlock createListBlock(java.util.regex.Matcher matcher)
-
tryContinue
public BlockContinue tryContinue(ParserState state)
Description copied from interface:BlockParser
See if the block parser can continue parsing the current block- Parameters:
state
- current parsing state- Returns:
- block continue instance
-
-