_ and *.
Note that implementations of this need to be thread-safe, the same instance may be used by multiple parsers.
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if can be open delimiterstring before delimiter or '\n' if none before, String string after delimiter or '\n' if none after, boolean is left flanking delimiter leftFlanking, boolean is right flanking delimiter rightFlanking, boolean is punctuation before beforeIsPunctuation, boolean is punctuation after afterIsPunctuation, boolean is whitespace before beforeIsWhitespace, boolean is whitespace after afterIsWhiteSpace)Decide whether this delimiter can be a close delimiter |
| public boolean | Returns: true if can be open delimiterstring before delimiter or '\n' if none before, String string after delimiter or '\n' if none after, boolean is left flanking delimiter leftFlanking, boolean is right flanking delimiter rightFlanking, boolean is punctuation before beforeIsPunctuation, boolean is punctuation after afterIsPunctuation, boolean is whitespace before beforeIsWhitespace, boolean is whitespace after afterIsWhiteSpace)Decide whether this delimiter can be an open delimiter |
| public char | Returns: 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.
|
| public int | Returns: how many delimiters should be used; must not be greater than length of either opener or closerthe opening delimiter run opener, DelimiterRun the closing delimiter run closer)Determine how many (if any) of the delimiter characters should be used. |
| public int | Returns: Minimum number of delimiter characters that are needed to activate this. Must be at least 1.
|
| public char | Returns: the character that marks the beginning of a delimited node, must not clash with any built-in special characters
|
| public void | process(Delimiter
the delimiter with text node that contained the opening delimiter opener, Delimiter the delimiter with text node that contained the closing delimiter closer, int the number of delimiters that were used delimitersUsed)Process the matched delimiters, e.g. by wrapping the nodes between opener and closer in a new node, or appending a new node after the opener. |
| public boolean | Returns: true if to skipWhether to skip delimiters that cannot be openers or closers |
| public Node | Returns: node to replace unmatched delimiter, null or delimiter.getNode() to replace with delimiter textinline parser instance inlineParser, DelimiterRun delimiter run that was not matched delimiter)Allow delimiter processor to substitute unmatched delimiters by custom nodes |
| canBeCloser | back to summary |
|---|---|
| public boolean canBeCloser(String before, String after, boolean leftFlanking, boolean rightFlanking, boolean beforeIsPunctuation, boolean afterIsPunctuation, boolean beforeIsWhitespace, boolean afterIsWhiteSpace) Decide whether this delimiter can be a close delimiter
| |
| canBeOpener | back to summary |
|---|---|
| public boolean canBeOpener(String before, String after, boolean leftFlanking, boolean rightFlanking, boolean beforeIsPunctuation, boolean afterIsPunctuation, boolean beforeIsWhitespace, boolean afterIsWhiteSpace) Decide whether this delimiter can be an open delimiter
| |
| getClosingCharacter | back to summary |
|---|---|
public char getClosingCharacter()
| |
| getDelimiterUse | back to summary |
|---|---|
| public int getDelimiterUse(DelimiterRun opener, DelimiterRun closer) Determine how many (if any) of the delimiter characters should be used. This allows implementations to decide how many characters to use based on the properties of the delimiter runs. An implementation can also return 0 when it doesn't want to allow this particular combination of delimiter runs.
| |
| getMinLength | back to summary |
|---|---|
public int getMinLength()
| |
| getOpeningCharacter | back to summary |
|---|---|
public char getOpeningCharacter()
| |
| process | back to summary |
|---|---|
| public void process(Delimiter opener, Delimiter closer, int delimitersUsed) Process the matched delimiters, e.g. by wrapping the nodes between opener and closer in a new node, or appending a new node after the opener. Note that removal of the delimiter from the delimiter nodes and unlinking them is done by the caller. | |
| skipNonOpenerCloser | back to summary |
|---|---|
| public boolean skipNonOpenerCloser() Whether to skip delimiters that cannot be openers or closers
| |
| unmatchedDelimiterNode | back to summary |
|---|---|
| public Node unmatchedDelimiterNode(InlineParser inlineParser, DelimiterRun delimiter) Allow delimiter processor to substitute unmatched delimiters by custom nodes
| |