APIdia Launch Partner
Top Description Methods
jdk.internal.org.commonmark.parser.delimiter

public Interface DelimiterProcessor

Known Direct Implementers
jdk.internal.org.commonmark.internal.StaggeredDelimiterProcessor, jdk.internal.org.commonmark.internal.inline.EmphasisDelimiterProcessor
Imports
jdk.internal.org.commonmark.node.Text

Custom delimiter processor for additional delimiters besides _ and *.

Note that implementations of this need to be thread-safe, the same instance may be used by multiple parsers.

Method Summary

Modifier and TypeMethod and Description
public char
getClosingCharacter()

Returns: the character that marks the the ending of a delimited node, must not clash with any built-in special characters.

public int
getMinLength()

Minimum number of delimiter characters that are needed to activate this.

public char
getOpeningCharacter()

Returns: the character that marks the beginning of a delimited node, must not clash with any built-in special characters

public int

Returns:

how many delimiters were used; must not be greater than length of either opener or closer
process
(DelimiterRun
the opening delimiter run
openingRun
,
DelimiterRun
the closing delimiter run
closingRun
)

Process the delimiter runs.

Method Detail

getClosingCharacterback to summary
public char getClosingCharacter()
Returns:char

the character that marks the the ending of a delimited node, must not clash with any built-in special characters. Note that for a symmetric delimiter such as "*", this is the same as the opening.

getMinLengthback to summary
public int getMinLength()

Minimum number of delimiter characters that are needed to activate this. Must be at least 1.

getOpeningCharacterback to summary
public char getOpeningCharacter()
Returns:char

the character that marks the beginning of a delimited node, must not clash with any built-in special characters

processback to summary
public int process(DelimiterRun openingRun, DelimiterRun closingRun)

Process the delimiter runs.

The processor can examine the runs and the nodes and decide if it wants to process or not. If not, it should not change any nodes and return 0. If yes, it should do the processing (wrapping nodes, etc) and then return how many delimiters were used.

Note that removal (unlinking) of the used delimiter Text nodes is done by the caller.

Parameters
openingRun:DelimiterRun

the opening delimiter run

closingRun:DelimiterRun

the closing delimiter run

Returns:int

how many delimiters were used; must not be greater than length of either opener or closer