Class EnumeratedReferenceLinkRefProcessor
java.lang.Object
com.vladsch.flexmark.ext.enumerated.reference.internal.EnumeratedReferenceLinkRefProcessor
- All Implemented Interfaces:
LinkRefProcessor
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intprivate final EnumeratedReferenceRepository(package private) static final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull BasedSequenceadjustInlineText(@NotNull Document document, @NotNull Node node) Adjust child nodes' text as needed when some of the link ref text was used in the opening or closing sequence of the node or if the children are not desired then removeIndex them.booleanallowDelimiters(@NotNull BasedSequence chars, @NotNull Document document, @NotNull Node node) Allows the delimiter processor to allow/disallow other delimiters in its inline text@NotNull NodecreateNode(@NotNull BasedSequence nodeChars) Create the desired element that was previously matched with isMatchintWhether the element consists of nested [] inside the link ref.booleanWhether the image ref is desired, if not then ! will be stripped off the prefix and treated as plain textbooleanisMatch(@NotNull BasedSequence nodeChars) Test whether the element matches desired one.voidupdateNodeElements(@NotNull Document document, @NotNull Node node) Allows the processor to adjust nodes' elements after all delimiters have been processed inside the inlined text
-
Field Details
-
WANT_EXCLAMATION_PREFIX
static final boolean WANT_EXCLAMATION_PREFIX- See Also:
-
BRACKET_NESTING_LEVEL
static final int BRACKET_NESTING_LEVEL- See Also:
-
enumeratedReferenceRepository
-
-
Constructor Details
-
EnumeratedReferenceLinkRefProcessor
-
-
Method Details
-
getWantExclamationPrefix
public boolean getWantExclamationPrefix()Description copied from interface:LinkRefProcessorWhether the image ref is desired, if not then ! will be stripped off the prefix and treated as plain text- Specified by:
getWantExclamationPrefixin interfaceLinkRefProcessor- Returns:
- true if ! is part of the desired element, false otherwise
-
getBracketNestingLevel
public int getBracketNestingLevel()Description copied from interface:LinkRefProcessorWhether the element consists of nested [] inside the link ref. For example Wiki link [[]] processor would return 1 Only immediately nested [] are considered. [[ ]] is nesting 1, [ [ ]] is not consideredWhen
>0then preview of next characters is used and if they will match then inner reference will not be created to allow outer one to match the desired element- Specified by:
getBracketNestingLevelin interfaceLinkRefProcessor- Returns:
- desired nesting level for references,
>0for nested, 0 for not nested
-
isMatch
Description copied from interface:LinkRefProcessorTest whether the element matches desired one. For processors that allow nesting this will be called one additional. time for each nesting level. Last call for the actual match, all others to pre-match to prevent a non-nested element from being created.- Specified by:
isMatchin interfaceLinkRefProcessor- Parameters:
nodeChars- text to match, including [] or ![]- Returns:
- true if it is a match
-
createNode
Description copied from interface:LinkRefProcessorCreate the desired element that was previously matched with isMatch- Specified by:
createNodein interfaceLinkRefProcessor- Parameters:
nodeChars- char sequence from which to create the node- Returns:
- Node element to be inserted into the tree
-
adjustInlineText
@NotNull public @NotNull BasedSequence adjustInlineText(@NotNull @NotNull Document document, @NotNull @NotNull Node node) Description copied from interface:LinkRefProcessorAdjust child nodes' text as needed when some of the link ref text was used in the opening or closing sequence of the node or if the children are not desired then removeIndex them.- Specified by:
adjustInlineTextin interfaceLinkRefProcessor- Parameters:
document- document, can be used to get parsing optionsnode- node whose inline text is to be adjusted to reflect some of the text having been used as part of the opener and/or closer sequence.- Returns:
- adjusted sequence to use for this node's child text
-
allowDelimiters
public boolean allowDelimiters(@NotNull @NotNull BasedSequence chars, @NotNull @NotNull Document document, @NotNull @NotNull Node node) Description copied from interface:LinkRefProcessorAllows the delimiter processor to allow/disallow other delimiters in its inline text- Specified by:
allowDelimitersin interfaceLinkRefProcessor- Parameters:
chars- character sub-sequence to testdocument- document, can be used to get optionsnode- delimited node created by this processor @return true if delimiters are allowed in this part of the node's text
-
updateNodeElements
Description copied from interface:LinkRefProcessorAllows the processor to adjust nodes' elements after all delimiters have been processed inside the inlined text- Specified by:
updateNodeElementsin interfaceLinkRefProcessor- Parameters:
document- document, can be used to get parsing optionsnode- node whose elements can be adjusted
-