Top Description Methods
com.vladsch.flexmark.formatter

public Interface NodeFormatterContext

extends NodeContext<Node, NodeFormatterContext>, TranslationContext, LinkResolverContext, ExplicitAttributeIdProvider
Known Direct Implementers
com.vladsch.flexmark.formatter.NodeFormatterSubContext, com.vladsch.flexmark.formatter.Formatter.MainNodeFormatter.SubNodeFormatter
Imports
com.vladsch.flexmark.formatter.internal.CoreNodeFormatter, com.vladsch.flexmark.html.renderer.LinkResolverContext, com.vladsch.flexmark.util.ast.Document, .Node, com.vladsch.flexmark.util.data.DataHolder, com.vladsch.flexmark.util.format.NodeContext, .TrackedOffsetList, com.vladsch.flexmark.util.format.options.ElementPlacementSort, com.vladsch.flexmark.util.misc.CharPredicate, com.vladsch.flexmark.util.sequence.BasedSequence, org.jetbrains.annotations.NotNull, java.util.Collection

The context for node rendering, including configuration and functionality for the node renderer to use.

Method Summary

Modifier and TypeMethod and Description
public void
delegateRender()

pass node rendering to previously registered handler

public @NotNull BasedSequence

Returns:

char sequence of all prefix chars which compact like block quote prefix char
getBlockQuoteLikePrefixChars
()

public @NotNull CharPredicate

Returns:

predicate for prefix chars which compact like block quote prefix char
getBlockQuoteLikePrefixPredicate
()

public @NotNull Document
public @NotNull FormatterOptions

Returns:

the FormatterOptions for the context.
getFormatterOptions
()

public @NotNull FormattingPhase

Returns:

current rendering phase
getFormattingPhase
()

public @NotNull MarkdownWriter

Returns:

the HTML writer to use
getMarkdown
()

public @NotNull DataHolder
public @NotNull TrackedOffsetList

Returns:

tracked offset list
getTrackedOffsets
()

public @NotNull BasedSequence

Returns:

original sequence used for tracked offsets.
getTrackedSequence
()

Note

parser can only use a contiguous sequence, not segmented.

public boolean
public @NotNull Iterable<? extends Node>

Returns:

iterable
nodesOfType
(@NotNull Class<?>[]
node classes to return
classes
)

Get iterable of nodes of given types, in order of their appearance in the document tree, depth first traversal.

public @NotNull Iterable<? extends Node>
public void
render(@NotNull Node
the node to render
node
)

Render the specified node and its children using the configured renderers.

public void
renderChildren(@NotNull Node
node the children of which are to be rendered
parent
)

Render the children of the node, used by custom renderers

public @NotNull Iterable<? extends Node>

Returns:

iterable
reversedNodesOfType
(@NotNull Class<?>[]
node classes to return
classes
)

Get iterable of nodes of given types, in reverse order of their appearance in the document tree, depth first traversal.

public @NotNull Iterable<? extends Node>
Inherited from com.vladsch.flexmark.formatter.ExplicitAttributeIdProvider:
addExplicitId
Inherited from com.vladsch.flexmark.formatter.TranslationContext:
customPlaceholderFormatgetIdGeneratorgetMergeContextgetRenderPurposegetTranslationStoreisPostProcessingNonTranslatingisTransformingTextnonTranslatingSpanpostProcessNonTranslatingpostProcessNonTranslatingtransformAnchorReftransformNonTranslatingtransformTranslatingtranslatingRefTargetSpantranslatingSpan
Inherited from com.vladsch.flexmark.html.renderer.LinkResolverContext:
encodeUrlgetCurrentNoderenderrenderChildrenresolveLinkresolveLink
Inherited from com.vladsch.flexmark.util.format.NodeContext:
getCurrentNodegetSubContextgetSubContextgetSubContext

Method Detail

delegateRenderback to summary
public void delegateRender()

pass node rendering to previously registered handler

getBlockQuoteLikePrefixCharsback to summary
public @NotNull BasedSequence getBlockQuoteLikePrefixChars()
Returns:@NotNull BasedSequence

char sequence of all prefix chars which compact like block quote prefix char

Annotations
@NotNull
getBlockQuoteLikePrefixPredicateback to summary
public @NotNull CharPredicate getBlockQuoteLikePrefixPredicate()
Returns:@NotNull CharPredicate

predicate for prefix chars which compact like block quote prefix char

Annotations
@NotNull
getDocumentback to summary
public @NotNull Document getDocument()

Redeclares com.vladsch.flexmark.html.renderer.LinkResolverContext.getDocument.

Returns:@NotNull Document

the Document node of the current context

Annotations
@NotNull
getFormatterOptionsback to summary
public @NotNull FormatterOptions getFormatterOptions()
Returns:@NotNull FormatterOptions

the FormatterOptions for the context.

Annotations
@NotNull
getFormattingPhaseback to summary
public @NotNull FormattingPhase getFormattingPhase()
Returns:@NotNull FormattingPhase

current rendering phase

Annotations
@NotNull
getMarkdownback to summary
public @NotNull MarkdownWriter getMarkdown()
Returns:@NotNull MarkdownWriter

the HTML writer to use

Annotations
@NotNull
getOptionsback to summary
public @NotNull DataHolder getOptions()

Redeclares com.vladsch.flexmark.util.format.NodeContext.getOptions, com.vladsch.flexmark.html.renderer.LinkResolverContext.getOptions.

Get the current rendering context DataHolder. These are the options passed or set on the Formatter#builder() or passed to Formatter#builder(DataHolder). To get the document options you should use getDocument() as the data holder.

Returns:@NotNull DataHolder

the current renderer options DataHolder

Annotations
@NotNull
getTrackedOffsetsback to summary
public @NotNull TrackedOffsetList getTrackedOffsets()
Returns:@NotNull TrackedOffsetList

tracked offset list

Annotations
@NotNull
getTrackedSequenceback to summary
public @NotNull BasedSequence getTrackedSequence()

Note

parser can only use a contiguous sequence, not segmented. Therefore, the AST offsets and base sequence from AST nodes has always an index into sequence equal to the offset. This sequence is set to not BasedSequence#NULL when the format sequence used for tracked offsets is not contiguous and TrackedOffset.offset is an offset from this sequence and need to be converted to index into this sequence to be used as an offset into AST sequence for offset conversion

Returns:@NotNull BasedSequence

original sequence used for tracked offsets.

Annotations
@NotNull
isRestoreTrackedSpacesback to summary
public boolean isRestoreTrackedSpaces()
nodesOfTypeback to summary
public @NotNull Iterable<? extends Node> nodesOfType(@NotNull Class<?>[] classes)

Get iterable of nodes of given types, in order of their appearance in the document tree, depth first traversal. Only node classes returned by NodeFormatter#getNodeClasses() of all loaded extensions will be available to formatters.

CoreNodeFormatter registers com.vladsch.flexmark.ast.RefNode if Formatter#REFERENCE_SORT is set to ElementPlacementSort#SORT_UNUSED_LAST so that

Parameters
classes:@NotNull Class<?>[]

node classes to return

Returns:@NotNull Iterable<? extends Node>

iterable

Annotations
@NotNull
nodesOfTypeback to summary
public @NotNull Iterable<? extends Node> nodesOfType(@NotNull Collection<Class<?>> classes)
Annotations
@NotNull
renderback to summary
public void render(@NotNull Node node)

Render the specified node and its children using the configured renderers. This should be used to render child nodes; be careful not to pass the node that is being rendered, that would result in an endless loop.

Parameters
node:@NotNull Node

the node to render

renderChildrenback to summary
public void renderChildren(@NotNull Node parent)

Render the children of the node, used by custom renderers

Parameters
parent:@NotNull Node

node the children of which are to be rendered

reversedNodesOfTypeback to summary
public @NotNull Iterable<? extends Node> reversedNodesOfType(@NotNull Class<?>[] classes)

Get iterable of nodes of given types, in reverse order of their appearance in the document tree, depth first traversal. Only node classes returned by NodeFormatter#getNodeClasses() of all loaded extensions will be available to formatters.

CoreNodeFormatter registers com.vladsch.flexmark.ast.RefNode if Formatter#REFERENCE_SORT is set to ElementPlacementSort#SORT_UNUSED_LAST so that

Parameters
classes:@NotNull Class<?>[]

node classes to return

Returns:@NotNull Iterable<? extends Node>

iterable

Annotations
@NotNull
reversedNodesOfTypeback to summary
public @NotNull Iterable<? extends Node> reversedNodesOfType(@NotNull Collection<Class<?>> classes)
Annotations
@NotNull