Top Fields Constructors Methods
com.vladsch.flexmark.formatter

public abstract Class NodeRepositoryFormatter<R extends NodeRepository<B>, B extends Node & ReferenceNode<R, B, N>, N extends Node & ReferencingNode<R, B>>

extends Object
implements PhasedNodeFormatter
Class Inheritance
All Implemented Interfaces
com.vladsch.flexmark.formatter.PhasedNodeFormatter, com.vladsch.flexmark.formatter.NodeFormatter
Known Direct Subclasses
com.vladsch.flexmark.formatter.internal.CoreNodeFormatter
Imports
com.vladsch.flexmark.html.HtmlRenderer, com.vladsch.flexmark.util.ast.*, com.vladsch.flexmark.util.data.DataHolder, .DataKey, .DataSet, com.vladsch.flexmark.util.format.options.ElementPlacement, .ElementPlacementSort, org.jetbrains.annotations.NotNull, .Nullable, java.util.*

Field Summary

Modifier and TypeField and Description
public static final HashSet<FormattingPhase>
protected final B
protected final Comparator<B>
private final DataKey<Map<String, String>>
private final DataKey<Map<String, String>>
protected boolean
protected final List<B>
protected final R
private Map<String, String>
protected Map<String, String>
protected boolean
protected final HashSet<Node>

Constructor Summary

AccessConstructor and Description
public
NodeRepositoryFormatter(DataHolder options, DataKey<Map<String, String>> referenceMapKey, DataKey<Map<String, String>> uniquificationMapKey)

Method Summary

Modifier and TypeMethod and Description
private void
public @Nullable Set<FormattingPhase>
public Comparator<B>
public abstract ElementPlacement
public abstract ElementPlacementSort
public abstract R
protected ElementPlacement
protected boolean

Returns:

true if yes, false if leave all references as is
makeReferencesUnique
()

Whether references should be made unique

public String
modifyTransformedReference(String transformedReferenceId, NodeFormatterContext context)

public void
protected void
protected abstract void
private void
protected String
protected void
uniquifyIds(NodeFormatterContext context, MarkdownWriter markdown, Document document)

Compute needed id map to make reference ids unique across documents[] up to entry equal to document and store this map in document property so that it can be retrieved from the document later when computing the map by documents after this document in the list.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FORMATTING_PHASESback to summary
public static final HashSet<FormattingPhase> FORMATTING_PHASES
lastReferenceback to summary
protected final B lastReference
myComparatorback to summary
protected final Comparator<B> myComparator
myReferenceMapKeyback to summary
private final DataKey<Map<String, String>> myReferenceMapKey
myReferenceUniqificationMapKeyback to summary
private final DataKey<Map<String, String>> myReferenceUniqificationMapKey
recheckUndefinedReferencesback to summary
protected boolean recheckUndefinedReferences
referenceListback to summary
protected final List<B> referenceList
referenceRepositoryback to summary
protected final R referenceRepository
referenceTranslationMapback to summary
private Map<String, String> referenceTranslationMap
referenceUniqificationMapback to summary
protected Map<String, String> referenceUniqificationMap
repositoryNodesDoneback to summary
protected boolean repositoryNodesDone
unusedReferencesback to summary
protected final HashSet<Node> unusedReferences

Constructor Detail

NodeRepositoryFormatterback to summary
public NodeRepositoryFormatter(DataHolder options, DataKey<Map<String, String>> referenceMapKey, DataKey<Map<String, String>> uniquificationMapKey)

Method Detail

formatReferencesback to summary
private void formatReferences(NodeFormatterContext context, MarkdownWriter markdown)
getFormattingPhasesback to summary
public @Nullable Set<FormattingPhase> getFormattingPhases()

Implements com.vladsch.flexmark.formatter.PhasedNodeFormatter.getFormattingPhases.

Annotations
@Nullable
@Override
getReferenceComparatorback to summary
public Comparator<B> getReferenceComparator()
getReferencePlacementback to summary
public abstract ElementPlacement getReferencePlacement()
getReferenceSortback to summary
public abstract ElementPlacementSort getReferenceSort()
getRepositoryback to summary
public abstract R getRepository(DataHolder options)
getTranslationReferencePlacementback to summary
protected ElementPlacement getTranslationReferencePlacement(NodeFormatterContext context)
makeReferencesUniqueback to summary
protected boolean makeReferencesUnique()

Whether references should be made unique

Returns:boolean

true if yes, false if leave all references as is

modifyTransformedReferenceback to summary
public String modifyTransformedReference(String transformedReferenceId, NodeFormatterContext context)
renderDocumentback to summary
public void renderDocument(@NotNull NodeFormatterContext context, @NotNull MarkdownWriter markdown, @NotNull Document document, @NotNull FormattingPhase phase)
Annotations
@Override
renderReferenceback to summary
protected void renderReference(B node, NodeFormatterContext context, MarkdownWriter markdown)
renderReferenceBlockback to summary
protected abstract void renderReferenceBlock(B node, NodeFormatterContext context, MarkdownWriter markdown)
renderReferenceBlockUniqueback to summary
private void renderReferenceBlockUnique(B node, NodeFormatterContext context, MarkdownWriter markdown)
transformReferenceIdback to summary
protected String transformReferenceId(String nodeText, NodeFormatterContext context)
uniquifyIdsback to summary
protected void uniquifyIds(NodeFormatterContext context, MarkdownWriter markdown, Document document)

Compute needed id map to make reference ids unique across documents[] up to entry equal to document and store this map in document property so that it can be retrieved from the document later when computing the map by documents after this document in the list.