public abstract class EmphasisDelimiterProcessor extends Object implements DelimiterProcessor
| Modifier | Constructor and Description |
|---|---|
protected |
EmphasisDelimiterProcessor(char delimiterChar,
boolean strongWrapsEmphasis) |
| Modifier and Type | Method and Description |
|---|---|
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
|
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
|
char |
getClosingCharacter() |
int |
getDelimiterUse(DelimiterRun opener,
DelimiterRun closer)
Determine how many (if any) of the delimiter characters should be used.
|
int |
getMinLength() |
char |
getOpeningCharacter() |
void |
process(Delimiter opener,
Delimiter closer,
int delimitersUsed)
Process the matched delimiters, e.g.
|
boolean |
skipNonOpenerCloser()
Whether to skip delimiters that cannot be openers or closers
|
com.vladsch.flexmark.ast.Node |
unmatchedDelimiterNode(InlineParser inlineParser,
DelimiterRun delimiter)
Allow delimiter processor to substitute unmatched delimiters by custom nodes
|
protected EmphasisDelimiterProcessor(char delimiterChar,
boolean strongWrapsEmphasis)
public char getOpeningCharacter()
getOpeningCharacter in interface DelimiterProcessorpublic char getClosingCharacter()
getClosingCharacter in interface DelimiterProcessorpublic int getMinLength()
getMinLength in interface DelimiterProcessorpublic boolean canBeOpener(String before, String after, boolean leftFlanking, boolean rightFlanking, boolean beforeIsPunctuation, boolean afterIsPunctuation, boolean beforeIsWhitespace, boolean afterIsWhiteSpace)
DelimiterProcessorcanBeOpener in interface DelimiterProcessorbefore - string before delimiter or '\n' if noneafter - string after delimiter or '\n' if noneleftFlanking - is left flanking delimiterrightFlanking - is right flanking delimiterbeforeIsPunctuation - is punctuation beforeafterIsPunctuation - is punctuation afterbeforeIsWhitespace - is whitespace beforeafterIsWhiteSpace - is whitespace afterpublic boolean canBeCloser(String before, String after, boolean leftFlanking, boolean rightFlanking, boolean beforeIsPunctuation, boolean afterIsPunctuation, boolean beforeIsWhitespace, boolean afterIsWhiteSpace)
DelimiterProcessorcanBeCloser in interface DelimiterProcessorbefore - string before delimiter or '\n' if noneafter - string after delimiter or '\n' if noneleftFlanking - is left flanking delimiterrightFlanking - is right flanking delimiterbeforeIsPunctuation - is punctuation beforeafterIsPunctuation - is punctuation afterbeforeIsWhitespace - is whitespace beforeafterIsWhiteSpace - is whitespace afterpublic boolean skipNonOpenerCloser()
DelimiterProcessorskipNonOpenerCloser in interface DelimiterProcessorpublic com.vladsch.flexmark.ast.Node unmatchedDelimiterNode(InlineParser inlineParser, DelimiterRun delimiter)
DelimiterProcessorunmatchedDelimiterNode in interface DelimiterProcessorinlineParser - inline parser instancedelimiter - delimiter run that was not matchedpublic int getDelimiterUse(DelimiterRun opener, DelimiterRun closer)
DelimiterProcessorThis 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.
getDelimiterUse in interface DelimiterProcessoropener - the opening delimiter runcloser - the closing delimiter runpublic void process(Delimiter opener, Delimiter closer, int delimitersUsed)
DelimiterProcessorNote that removal of the delimiter from the delimiter nodes and unlinking them is done by the caller.
process in interface DelimiterProcessoropener - the delimiter with text node that contained the opening delimitercloser - the delimiter with text node that contained the closing delimiterdelimitersUsed - the number of delimiters that were usedCopyright © 2018. All rights reserved.