Top Description Methods
com.vladsch.flexmark.parser.block

public Interface BlockParser

Known Direct Implementers
com.vladsch.flexmark.parser.block.AbstractBlockParser
Imports
com.vladsch.flexmark.parser.InlineParser, com.vladsch.flexmark.parser.core.ParagraphParser, com.vladsch.flexmark.util.ast.Block, .BlockContent, com.vladsch.flexmark.util.data.MutableDataHolder, com.vladsch.flexmark.util.sequence.BasedSequence

Parser for a specific block node.

Implementations should subclass AbstractBlockParser instead of implementing this directly.

Method Summary

Modifier and TypeMethod and Description
public void
addLine(ParserState
parser state
state
,
BasedSequence
line sequence
line
)

Add another line to the block

public boolean

Returns:

true if Double blank line should finalize this block parser and its children and reset to parent
breakOutOnDoubleBlankLine
()

public boolean
canContain(ParserState
parser state
state
,
BlockParser
block parser
blockParser
,
Block
new block being started @return true if this block parser's block can contain the given block type, false if it cannot
block
)

public boolean

Returns:

true if can interrupt.
canInterruptBy
(BlockParserFactory
interrupting block parser
blockParserFactory
)

Allows block parsers to determine if they can be interrupted by other block parsers

public void
public void
finalizeClosedBlock()

Used to clean up and prepare for the next parsing run of the AbstractBlockParser for internal parser house keeping not for BlockParser implementors

public Block

Returns:

the block parser's block node instance
getBlock
()

public BlockContent

Returns:

get the currently accumulated block content. May or may not be implemented by any parser except for the ParagraphParser or one that returns true for isParagraphParser()
getBlockContent
()

public MutableDataHolder

Returns:

the data holder for a block parser instance. Implemented by AbstractBlockParser
getDataHolder
()

public boolean

Returns:

true if the block is already closed.
isClosed
()

public boolean

Returns:

true if the block that is parsed is a container (contains other blocks), or false if it's a leaf.
isContainer
()

public boolean

Returns:

true if block starts should be tried when this block parser is active
isInterruptible
()

Allows block parsers to be interrupted by other block parsers

public boolean

Returns:

true if this block parser is the paragraph block parser
isParagraphParser
()

public boolean

Returns:

true if the last blank line status should be propagated to parent blocks
isPropagatingLastBlankLine
(BlockParser
last matched block parser instance
lastMatchedBlockParser
)

public boolean

Returns:

true if block wants to keep indenting spaces
isRawText
()

Allows block parsers to keep indenting spaces for those blocks that are interruptible but don't want indenting spaces removed.

public void
parseInlines(InlineParser
instance of inline parser
inlineParser
)

Do inline processing for the block content using the given inline parser interface

public BlockContinue

Returns:

block continue instance
tryContinue
(ParserState
current parsing state
state
)

See if the block parser can continue parsing the current block

Method Detail

addLineback to summary
public void addLine(ParserState state, BasedSequence line)

Add another line to the block

Parameters
state:ParserState

parser state

line:BasedSequence

line sequence

breakOutOnDoubleBlankLineback to summary
public boolean breakOutOnDoubleBlankLine()
Returns:boolean

true if Double blank line should finalize this block parser and its children and reset to parent

canContainback to summary
public boolean canContain(ParserState state, BlockParser blockParser, Block block)
Parameters
state:ParserState

parser state

blockParser:BlockParser

block parser

block:Block

new block being started @return true if this block parser's block can contain the given block type, false if it cannot

canInterruptByback to summary
public boolean canInterruptBy(BlockParserFactory blockParserFactory)

Allows block parsers to determine if they can be interrupted by other block parsers

Parameters
blockParserFactory:BlockParserFactory

interrupting block parser

Returns:boolean

true if can interrupt.

closeBlockback to summary
public void closeBlock(ParserState state)
finalizeClosedBlockback to summary
public void finalizeClosedBlock()

Used to clean up and prepare for the next parsing run of the AbstractBlockParser for internal parser house keeping not for BlockParser implementors

getBlockback to summary
public Block getBlock()
Returns:Block

the block parser's block node instance

getBlockContentback to summary
public BlockContent getBlockContent()
Returns:BlockContent

get the currently accumulated block content. May or may not be implemented by any parser except for the ParagraphParser or one that returns true for isParagraphParser()

getDataHolderback to summary
public MutableDataHolder getDataHolder()
Returns:MutableDataHolder

the data holder for a block parser instance. Implemented by AbstractBlockParser

isClosedback to summary
public boolean isClosed()
Returns:boolean

true if the block is already closed.

isContainerback to summary
public boolean isContainer()
Returns:boolean

true if the block that is parsed is a container (contains other blocks), or false if it's a leaf.

isInterruptibleback to summary
public boolean isInterruptible()

Allows block parsers to be interrupted by other block parsers

Returns:boolean

true if block starts should be tried when this block parser is active

isParagraphParserback to summary
public boolean isParagraphParser()
Returns:boolean

true if this block parser is the paragraph block parser

isPropagatingLastBlankLineback to summary
public boolean isPropagatingLastBlankLine(BlockParser lastMatchedBlockParser)
Parameters
lastMatchedBlockParser:BlockParser

last matched block parser instance

Returns:boolean

true if the last blank line status should be propagated to parent blocks

isRawTextback to summary
public boolean isRawText()

Allows block parsers to keep indenting spaces for those blocks that are interruptible but don't want indenting spaces removed.

Returns:boolean

true if block wants to keep indenting spaces

parseInlinesback to summary
public void parseInlines(InlineParser inlineParser)

Do inline processing for the block content using the given inline parser interface

Parameters
inlineParser:InlineParser

instance of inline parser

tryContinueback to summary
public BlockContinue tryContinue(ParserState state)

See if the block parser can continue parsing the current block

Parameters
state:ParserState

current parsing state

Returns:BlockContinue

block continue instance