Class WikiLinkNodeFormatter
- java.lang.Object
-
- com.vladsch.flexmark.ext.wikilink.internal.WikiLinkNodeFormatter
-
- All Implemented Interfaces:
NodeFormatter,PhasedNodeFormatter
public class WikiLinkNodeFormatter extends java.lang.Object implements PhasedNodeFormatter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWikiLinkNodeFormatter.Factory
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>attributeUniquificationIdMapstatic java.util.HashSet<FormattingPhase>FORMATTING_PHASESprivate WikiLinkOptionsoptions
-
Constructor Summary
Constructors Constructor Description WikiLinkNodeFormatter(DataHolder options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.CharSequenceescapePipeAnchors(java.lang.CharSequence chars)private java.lang.CharSequenceescapeUnescapedPipeAnchors(java.lang.CharSequence chars)@Nullable java.util.Set<FormattingPhase>getFormattingPhases()@Nullable java.util.Set<java.lang.Class<?>>getNodeClasses()Collect nodes of given type so that they can be quickly accessed without traversing the AST by all formatting extensions.@Nullable java.util.Set<NodeFormattingHandler<?>>getNodeFormattingHandlers()private voidrender(WikiImage node, NodeFormatterContext context, MarkdownWriter markdown)private voidrender(WikiLink node, NodeFormatterContext context, MarkdownWriter markdown)voidrenderDocument(@NotNull NodeFormatterContext context, @NotNull MarkdownWriter markdown, @NotNull Document document, @NotNull FormattingPhase phase)Render the specified node.private voidrenderLink(WikiNode node, NodeFormatterContext context, MarkdownWriter markdown)private voidrenderText(WikiNode node, NodeFormatterContext context, MarkdownWriter markdown)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vladsch.flexmark.formatter.NodeFormatter
getBlockQuoteLikePrefixChar
-
-
-
-
Field Detail
-
FORMATTING_PHASES
public static final java.util.HashSet<FormattingPhase> FORMATTING_PHASES
-
attributeUniquificationIdMap
private java.util.Map<java.lang.String,java.lang.String> attributeUniquificationIdMap
-
options
private WikiLinkOptions options
-
-
Constructor Detail
-
WikiLinkNodeFormatter
public WikiLinkNodeFormatter(DataHolder options)
-
-
Method Detail
-
getNodeFormattingHandlers
@Nullable public @Nullable java.util.Set<NodeFormattingHandler<?>> getNodeFormattingHandlers()
- Specified by:
getNodeFormattingHandlersin interfaceNodeFormatter- Returns:
- the mapping of nodes this renderer handles to rendering function
-
getNodeClasses
@Nullable public @Nullable java.util.Set<java.lang.Class<?>> getNodeClasses()
Description copied from interface:NodeFormatterCollect nodes of given type so that they can be quickly accessed without traversing the AST by all formatting extensions.- Specified by:
getNodeClassesin interfaceNodeFormatter- Returns:
- the nodes of interest to this formatter during formatting.
-
getFormattingPhases
@Nullable public @Nullable java.util.Set<FormattingPhase> getFormattingPhases()
- Specified by:
getFormattingPhasesin interfacePhasedNodeFormatter
-
renderDocument
public void renderDocument(@NotNull @NotNull NodeFormatterContext context, @NotNull @NotNull MarkdownWriter markdown, @NotNull @NotNull Document document, @NotNull @NotNull FormattingPhase phase)Description copied from interface:PhasedNodeFormatterRender the specified node.- Specified by:
renderDocumentin interfacePhasedNodeFormatter- Parameters:
context- node renderer context instancemarkdown- markdown writer instancedocument- the document node to renderphase- rendering phase for which to generate the output. Will be any ofFormattingPhaseexceptFormattingPhase.DOCUMENTbecause this phase is used for the non-phased node rendering
-
render
private void render(WikiLink node, NodeFormatterContext context, MarkdownWriter markdown)
-
render
private void render(WikiImage node, NodeFormatterContext context, MarkdownWriter markdown)
-
renderText
private void renderText(WikiNode node, NodeFormatterContext context, MarkdownWriter markdown)
-
escapeUnescapedPipeAnchors
private java.lang.CharSequence escapeUnescapedPipeAnchors(java.lang.CharSequence chars)
-
escapePipeAnchors
private java.lang.CharSequence escapePipeAnchors(java.lang.CharSequence chars)
-
renderLink
private void renderLink(WikiNode node, NodeFormatterContext context, MarkdownWriter markdown)
-
-