Package com.vladsch.flexmark.formatter
Class Formatter.Builder
- java.lang.Object
-
- com.vladsch.flexmark.util.data.DataSet
-
- com.vladsch.flexmark.util.data.MutableDataSet
-
- com.vladsch.flexmark.util.builder.BuilderBase<Formatter.Builder>
-
- com.vladsch.flexmark.formatter.Formatter.Builder
-
- All Implemented Interfaces:
com.vladsch.flexmark.util.data.DataHolder
,com.vladsch.flexmark.util.data.MutableDataHolder
,com.vladsch.flexmark.util.data.MutableDataSetter
- Enclosing class:
- Formatter
public static class Formatter.Builder extends com.vladsch.flexmark.util.builder.BuilderBase<Formatter.Builder>
Builder for configuring anFormatter
. See methods for default configuration.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Formatter
build()
@NotNull Formatter.Builder
htmlIdGeneratorFactory(@NotNull HeaderIdGeneratorFactory htmlIdGeneratorFactory)
Add a factory for generating the header id attribute from the header's text@NotNull Formatter.Builder
linkResolverFactory(@NotNull LinkResolverFactory linkResolverFactory)
Add a factory for instantiating a node renderer (done when rendering).protected boolean
loadExtension(@NotNull com.vladsch.flexmark.util.misc.Extension extension)
Formatter.Builder
nodeFormatterFactory(NodeFormatterFactory nodeFormatterFactory)
Add a factory for instantiating a node renderer (done when rendering).protected void
preloadExtension(@NotNull com.vladsch.flexmark.util.misc.Extension extension)
protected void
removeApiPoint(@NotNull Object apiPoint)
-
Methods inherited from class com.vladsch.flexmark.util.builder.BuilderBase
addExtensionApiPoint, extensions, get, loadExtensions, removeExtensions, set, set
-
Methods inherited from class com.vladsch.flexmark.util.data.MutableDataSet
clear, getOrCompute, merge, remove, setAll, setFrom, setIn, toDataSet, toImmutable, toMutable
-
Methods inherited from class com.vladsch.flexmark.util.data.DataSet
aggregate, aggregate, aggregateActions, contains, equals, getAll, getKeys, hashCode, registerDataKeyAggregator, toString
-
-
-
-
Method Detail
-
build
@NotNull public @NotNull Formatter build()
- Specified by:
build
in classcom.vladsch.flexmark.util.builder.BuilderBase<Formatter.Builder>
- Returns:
- the configured
Formatter
-
removeApiPoint
protected void removeApiPoint(@NotNull @NotNull Object apiPoint)
- Specified by:
removeApiPoint
in classcom.vladsch.flexmark.util.builder.BuilderBase<Formatter.Builder>
-
preloadExtension
protected void preloadExtension(@NotNull @NotNull com.vladsch.flexmark.util.misc.Extension extension)
- Specified by:
preloadExtension
in classcom.vladsch.flexmark.util.builder.BuilderBase<Formatter.Builder>
-
loadExtension
protected boolean loadExtension(@NotNull @NotNull com.vladsch.flexmark.util.misc.Extension extension)
- Specified by:
loadExtension
in classcom.vladsch.flexmark.util.builder.BuilderBase<Formatter.Builder>
-
nodeFormatterFactory
public Formatter.Builder nodeFormatterFactory(NodeFormatterFactory nodeFormatterFactory)
Add a factory for instantiating a node renderer (done when rendering). This allows to override the rendering of node types or define rendering for custom node types.If multiple node renderers for the same node type are created, the one from the factory that was added first "wins". (This is how the rendering for core node types can be overridden; the default rendering comes last.)
- Parameters:
nodeFormatterFactory
- the factory for creating a node renderer- Returns:
this
-
htmlIdGeneratorFactory
@NotNull public @NotNull Formatter.Builder htmlIdGeneratorFactory(@NotNull @NotNull HeaderIdGeneratorFactory htmlIdGeneratorFactory)
Add a factory for generating the header id attribute from the header's text- Parameters:
htmlIdGeneratorFactory
- the factory for generating header tag id attributes- Returns:
this
-
linkResolverFactory
@NotNull public @NotNull Formatter.Builder linkResolverFactory(@NotNull @NotNull LinkResolverFactory linkResolverFactory)
Add a factory for instantiating a node renderer (done when rendering). This allows to override the rendering of node types or define rendering for custom node types.If multiple node renderers for the same node type are created, the one from the factory that was added first "wins". (This is how the rendering for core node types can be overridden; the default rendering comes last.)
- Parameters:
linkResolverFactory
- the factory for creating a node renderer- Returns:
this
-
-