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 classListBlockParser.BlockFactorystatic classListBlockParser.Factory(package private) static classListBlockParser.ListData(package private) static classListBlockParser.ListItemLeadInHandler
-
Field Summary
Fields Modifier and Type Field Description private ListBlockmyBlock(package private) BasedSequencemyItemHandledLine(package private) booleanmyItemHandledNewItemLine(package private) booleanmyItemHandledNewListLine(package private) booleanmyItemHandledSkipActiveLine(package private) ListItemParsermyLastChildprivate ListBlockParser.ListDatamyListDataprivate ListOptionsmyOptions
-
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 booleanbreakOutOnDoubleBlankLine()booleancanContain(ParserState state, BlockParser blockParser, Block block)voidcloseBlock(ParserState state)private static ListBlockcreateListBlock(java.util.regex.Matcher matcher)private voidfinalizeListTight(ParserState parserState)ListBlockgetBlock()(package private) intgetContentIndent()(package private) BasedSequencegetItemHandledLine()ListItemParsergetLastChild()(package private) intgetLastContentIndent()ListBlockParser.ListDatagetListData()ListOptionsgetOptions()private static booleanhasNonItemChildren(ListItem item)booleanisContainer()(package private) static ListBlockParser.ListDataparseListMarker(ListOptions options, int newItemCodeIndent, ParserState state)Parse a list marker and return data on the marker or null.(package private) voidsetItemHandledLine(BasedSequence itemHandledLine)(package private) voidsetItemHandledLineSkipActive(BasedSequence itemHandledLine)(package private) voidsetItemHandledNewItemLine(BasedSequence itemHandledLine)(package private) voidsetItemHandledNewListLine(BasedSequence itemHandledLine)voidsetLastChild(ListItemParser lastChild)private voidsetTight(boolean tight)BlockContinuetryContinue(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:
isContainerin interfaceBlockParser- Overrides:
isContainerin 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:
canContainin interfaceBlockParser- Overrides:
canContainin 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:
breakOutOnDoubleBlankLinein interfaceBlockParser- Overrides:
breakOutOnDoubleBlankLinein 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:BlockParserSee if the block parser can continue parsing the current block- Parameters:
state- current parsing state- Returns:
- block continue instance
-
-