Class SimTocBlockParser
- java.lang.Object
-
- com.vladsch.flexmark.parser.block.AbstractBlockParser
-
- com.vladsch.flexmark.ext.toc.internal.SimTocBlockParser
-
- All Implemented Interfaces:
BlockParser
public class SimTocBlockParser extends AbstractBlockParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
SimTocBlockParser.BlockFactory
static class
SimTocBlockParser.Factory
(package private) static class
SimTocBlockParser.TocParsing
-
Field Summary
Fields Modifier and Type Field Description private BasedSequence
blankLineSpacer
private SimTocBlock
block
(package private) static int
HAVE_BLANK_LINE
(package private) static int
HAVE_HEADING
(package private) static int
HAVE_HTML
(package private) static int
HAVE_LIST
private int
haveChildren
private TocOptions
options
-
Constructor Summary
Constructors Constructor Description SimTocBlockParser(DataHolder options, BasedSequence tocChars, BasedSequence styleChars, BasedSequence titleChars)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLine(ParserState state, BasedSequence line)
Add another line to the blockboolean
canContain(ParserState state, BlockParser blockParser, Block block)
void
closeBlock(ParserState state)
Block
getBlock()
boolean
isContainer()
void
parseInlines(InlineParser inlineParser)
Do inline processing for the block content using the given inline parser interfaceBlockContinue
tryContinue(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, getBlockContent, getDataHolder, isClosed, isInterruptible, isParagraphParser, isPropagatingLastBlankLine, isRawText, removeBlankLines
-
-
-
-
Field Detail
-
HAVE_HTML
static int HAVE_HTML
-
HAVE_HEADING
static int HAVE_HEADING
-
HAVE_LIST
static int HAVE_LIST
-
HAVE_BLANK_LINE
static int HAVE_BLANK_LINE
-
block
private final SimTocBlock block
-
options
private final TocOptions options
-
haveChildren
private int haveChildren
-
blankLineSpacer
private BasedSequence blankLineSpacer
-
-
Constructor Detail
-
SimTocBlockParser
SimTocBlockParser(DataHolder options, BasedSequence tocChars, BasedSequence styleChars, BasedSequence titleChars)
-
-
Method Detail
-
getBlock
public Block getBlock()
- Returns:
- the block parser's block node instance
-
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
-
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
-
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.
-
addLine
public void addLine(ParserState state, BasedSequence line)
Description copied from interface:BlockParser
Add another line to the block- Specified by:
addLine
in interfaceBlockParser
- Overrides:
addLine
in classAbstractBlockParser
- Parameters:
state
- parser stateline
- line sequence
-
closeBlock
public void closeBlock(ParserState state)
-
parseInlines
public void parseInlines(InlineParser inlineParser)
Description copied from interface:BlockParser
Do inline processing for the block content using the given inline parser interface- Specified by:
parseInlines
in interfaceBlockParser
- Overrides:
parseInlines
in classAbstractBlockParser
- Parameters:
inlineParser
- instance of inline parser
-
-