Class AbstractBlockParser
java.lang.Object
com.vladsch.flexmark.parser.block.AbstractBlockParser
- All Implemented Interfaces:
BlockParser
- Direct Known Subclasses:
AbbreviationBlockParser, AdmonitionBlockParser, AsideBlockParser, BlockQuoteParser, DefinitionItemBlockParser, DocumentBlockParser, EnumeratedReferenceBlockParser, FencedCodeBlockParser, FootnoteBlockParser, GitLabBlockQuoteParser, HeadingParser, HtmlBlockParser, IndentedCodeBlockParser, JekyllFrontMatterBlockParser, JekyllTagBlockParser, ListBlockParser, ListItemParser, MacroBlockParser, MacroDefinitionBlockParser, ParagraphParser, SimTocBlockParser, SpecExampleBlockParser, ThematicBreakParser, TocBlockParser, YamlFrontMatterBlockParser, ZzzzzzBlockParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLine(ParserState state, BasedSequence line) Add another line to the blockbooleanbooleancanContain(ParserState state, BlockParser blockParser, Block block) booleancanInterruptBy(BlockParserFactory blockParserFactory) Allows block parsers to determine if they can be interrupted by other block parsersfinal voidUsed to clean up and prepare for the next parsing run of the AbstractBlockParser for internal parser house keeping not for BlockParser implementorsbooleanisClosed()booleanbooleanAllows block parsers to be interrupted by other block parsersbooleanbooleanisPropagatingLastBlankLine(BlockParser lastMatchedBlockParser) should be overridden in BlockQuote, FencedCode and ListItembooleanAllows block parsers to keep indenting spaces for those blocks that are interruptible but don't want indenting spaces removed.voidparseInlines(InlineParser inlineParser) Do inline processing for the block content using the given inline parser interfacevoidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BlockParser
closeBlock, getBlock, tryContinue
-
Field Details
-
mutableData
-
isClosed
private boolean isClosed
-
-
Constructor Details
-
AbstractBlockParser
public AbstractBlockParser()
-
-
Method Details
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceBlockParser- Returns:
- true if the block is already closed.
-
isContainer
public boolean isContainer()- Specified by:
isContainerin interfaceBlockParser- Returns:
- true if the block that is parsed is a container (contains other blocks), or false if it's a leaf.
-
isInterruptible
public boolean isInterruptible()Description copied from interface:BlockParserAllows block parsers to be interrupted by other block parsers- Specified by:
isInterruptiblein interfaceBlockParser- Returns:
- true if block starts should be tried when this block parser is active
-
isRawText
public boolean isRawText()Description copied from interface:BlockParserAllows block parsers to keep indenting spaces for those blocks that are interruptible but don't want indenting spaces removed.- Specified by:
isRawTextin interfaceBlockParser- Returns:
- true if block wants to keep indenting spaces
-
canContain
- Specified by:
canContainin interfaceBlockParser- 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
-
isParagraphParser
public boolean isParagraphParser()- Specified by:
isParagraphParserin interfaceBlockParser- Returns:
- true if this block parser is the paragraph block parser
-
isPropagatingLastBlankLine
should be overridden in BlockQuote, FencedCode and ListItem- Specified by:
isPropagatingLastBlankLinein interfaceBlockParser- Parameters:
lastMatchedBlockParser- the last matched block parser instance- Returns:
- true if the blank line should be propagated to parent
-
getBlockContent
- Specified by:
getBlockContentin interfaceBlockParser- Returns:
- get the currently accumulated block content. May or may not be implemented by any parser except for the
ParagraphParseror one that returns true forBlockParser.isParagraphParser()
-
addLine
Description copied from interface:BlockParserAdd another line to the block- Specified by:
addLinein interfaceBlockParser- Parameters:
state- parser stateline- line sequence
-
parseInlines
Description copied from interface:BlockParserDo inline processing for the block content using the given inline parser interface- Specified by:
parseInlinesin interfaceBlockParser- Parameters:
inlineParser- instance of inline parser
-
breakOutOnDoubleBlankLine
public boolean breakOutOnDoubleBlankLine()- Specified by:
breakOutOnDoubleBlankLinein interfaceBlockParser- Returns:
- true if Double blank line should finalize this block parser and its children and reset to parent
-
finalizeClosedBlock
public final void finalizeClosedBlock()Description copied from interface:BlockParserUsed to clean up and prepare for the next parsing run of the AbstractBlockParser for internal parser house keeping not for BlockParser implementors- Specified by:
finalizeClosedBlockin interfaceBlockParser
-
canInterruptBy
Description copied from interface:BlockParserAllows block parsers to determine if they can be interrupted by other block parsers- Specified by:
canInterruptByin interfaceBlockParser- Parameters:
blockParserFactory- interrupting block parser- Returns:
- true if can interrupt.
-
getDataHolder
- Specified by:
getDataHolderin interfaceBlockParser- Returns:
- the data holder for a block parser instance. Implemented by
AbstractBlockParser
-
removeBlankLines
public void removeBlankLines()
-