Class FootnoteLinkRefProcessor
- java.lang.Object
-
- com.vladsch.flexmark.ext.footnotes.internal.FootnoteLinkRefProcessor
-
- All Implemented Interfaces:
LinkRefProcessor
public class FootnoteLinkRefProcessor extends java.lang.Object implements LinkRefProcessor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FootnoteLinkRefProcessor.Factory
-
Constructor Summary
Constructors Constructor Description FootnoteLinkRefProcessor(Document document)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BasedSequence
adjustInlineText(Document document, 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.boolean
allowDelimiters(BasedSequence chars, Document document, Node node)
Allows the delimiter processor to allow/disallow other delimiters in its inline textNode
createNode(BasedSequence nodeChars)
Create the desired element that was previously matched with isMatchint
getBracketNestingLevel()
Whether the element consists of nested [] inside the link ref.boolean
getWantExclamationPrefix()
Whether the image ref is desired, if not then ! will be stripped off the prefix and treated as plain textboolean
isMatch(BasedSequence nodeChars)
Test whether the element matches desired one.void
updateNodeElements(Document document, Node node)
Allows the processor to adjust nodes' elements after all delimiters have been processed inside the inlined text
-
-
-
Constructor Detail
-
FootnoteLinkRefProcessor
public FootnoteLinkRefProcessor(Document document)
-
-
Method Detail
-
getWantExclamationPrefix
public boolean getWantExclamationPrefix()
Description copied from interface:LinkRefProcessor
Whether the image ref is desired, if not then ! will be stripped off the prefix and treated as plain text- Specified by:
getWantExclamationPrefix
in interfaceLinkRefProcessor
- Returns:
- true if ! is part of the desired element, false otherwise
-
getBracketNestingLevel
public int getBracketNestingLevel()
Description copied from interface:LinkRefProcessor
Whether 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
>0
then 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:
getBracketNestingLevel
in interfaceLinkRefProcessor
- Returns:
- desired nesting level for references,
>0
for nested, 0 for not nested
-
isMatch
public boolean isMatch(@NotNull BasedSequence nodeChars)
Description copied from interface:LinkRefProcessor
Test 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:
isMatch
in interfaceLinkRefProcessor
- Parameters:
nodeChars
- text to match, including [] or ![]- Returns:
- true if it is a match
-
createNode
@NotNull public Node createNode(@NotNull BasedSequence nodeChars)
Description copied from interface:LinkRefProcessor
Create the desired element that was previously matched with isMatch- Specified by:
createNode
in interfaceLinkRefProcessor
- Parameters:
nodeChars
- char sequence from which to create the node- Returns:
- Node element to be inserted into the tree
-
adjustInlineText
@NotNull public BasedSequence adjustInlineText(@NotNull Document document, @NotNull Node node)
Description copied from interface:LinkRefProcessor
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.- Specified by:
adjustInlineText
in 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 BasedSequence chars, @NotNull Document document, @NotNull Node node)
Description copied from interface:LinkRefProcessor
Allows the delimiter processor to allow/disallow other delimiters in its inline text- Specified by:
allowDelimiters
in 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
public void updateNodeElements(@NotNull Document document, @NotNull Node node)
Description copied from interface:LinkRefProcessor
Allows the processor to adjust nodes' elements after all delimiters have been processed inside the inlined text- Specified by:
updateNodeElements
in interfaceLinkRefProcessor
- Parameters:
document
- document, can be used to get parsing optionsnode
- node whose elements can be adjusted
-
-