Class FootnoteBlockParser
- java.lang.Object
-
- com.vladsch.flexmark.parser.block.AbstractBlockParser
-
- com.vladsch.flexmark.ext.footnotes.internal.FootnoteBlockParser
-
- All Implemented Interfaces:
BlockParser
public class FootnoteBlockParser extends AbstractBlockParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classFootnoteBlockParser.BlockFactorystatic classFootnoteBlockParser.Factory
-
Field Summary
Fields Modifier and Type Field Description private FootnoteBlockblockprivate BlockContentcontentprivate intcontentOffset(package private) static java.util.regex.PatternFOOTNOTE_DEF_PATTERN(package private) static java.lang.StringFOOTNOTE_ID(package private) static java.util.regex.PatternFOOTNOTE_ID_PATTERNprivate FootnoteOptionsoptions
-
Constructor Summary
Constructors Constructor Description FootnoteBlockParser(FootnoteOptions options, int contentOffset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLine(ParserState state, BasedSequence line)Add another line to the blockbooleancanContain(ParserState state, BlockParser blockParser, Block block)voidcloseBlock(ParserState state)BlockgetBlock()BlockContentgetBlockContent()booleanisContainer()BlockContinuetryContinue(ParserState state)See if the block parser can continue parsing the current block-
Methods inherited from class com.vladsch.flexmark.parser.block.AbstractBlockParser
breakOutOnDoubleBlankLine, canInterruptBy, finalizeClosedBlock, getDataHolder, isClosed, isInterruptible, isParagraphParser, isPropagatingLastBlankLine, isRawText, parseInlines, removeBlankLines
-
-
-
-
Field Detail
-
FOOTNOTE_ID
static java.lang.String FOOTNOTE_ID
-
FOOTNOTE_ID_PATTERN
static java.util.regex.Pattern FOOTNOTE_ID_PATTERN
-
FOOTNOTE_DEF_PATTERN
static java.util.regex.Pattern FOOTNOTE_DEF_PATTERN
-
block
private final FootnoteBlock block
-
options
private final FootnoteOptions options
-
contentOffset
private final int contentOffset
-
content
private BlockContent content
-
-
Constructor Detail
-
FootnoteBlockParser
public FootnoteBlockParser(FootnoteOptions options, int contentOffset)
-
-
Method Detail
-
getBlockContent
public BlockContent getBlockContent()
- Specified by:
getBlockContentin interfaceBlockParser- Overrides:
getBlockContentin classAbstractBlockParser- 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()
-
getBlock
public Block getBlock()
- Returns:
- the block parser's block node instance
-
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
-
addLine
public void addLine(ParserState state, BasedSequence line)
Description copied from interface:BlockParserAdd another line to the block- Specified by:
addLinein interfaceBlockParser- Overrides:
addLinein classAbstractBlockParser- Parameters:
state- parser stateline- line sequence
-
closeBlock
public void closeBlock(ParserState state)
-
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
-
-