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:
DataHolder
,MutableDataHolder
,MutableDataSetter
- Enclosing class:
- Formatter
public static class Formatter.Builder extends BuilderBase<Formatter.Builder>
Builder for configuring anFormatter
. See methods for default configuration.
-
-
Field Summary
-
Fields inherited from interface com.vladsch.flexmark.util.data.DataHolder
NULL
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(DataHolder options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Formatter
build()
Formatter.Builder
htmlIdGeneratorFactory(HeaderIdGeneratorFactory htmlIdGeneratorFactory)
Add a factory for generating the header id attribute from the header's textFormatter.Builder
linkResolverFactory(LinkResolverFactory linkResolverFactory)
Add a factory for instantiating a node renderer (done when rendering).protected boolean
loadExtension(Extension extension)
Load extension if it is validFormatter.Builder
nodeFormatterFactory(NodeFormatterFactory nodeFormatterFactory)
Add a factory for instantiating a node renderer (done when rendering).protected void
preloadExtension(Extension extension)
Preload operation for extension, perform any data config and other operation needed for loading extensionprotected void
removeApiPoint(java.lang.Object apiPoint)
Remove apiPoint from state information-
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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.vladsch.flexmark.util.data.DataHolder
contains, getAll, getKeys
-
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(DataHolder options)
-
-
Method Detail
-
build
@NotNull public Formatter build()
- Specified by:
build
in classBuilderBase<Formatter.Builder>
- Returns:
- the configured
Formatter
-
removeApiPoint
protected void removeApiPoint(@NotNull java.lang.Object apiPoint)
Description copied from class:BuilderBase
Remove apiPoint from state information- Specified by:
removeApiPoint
in classBuilderBase<Formatter.Builder>
- Parameters:
apiPoint
- api point object
-
preloadExtension
protected void preloadExtension(@NotNull Extension extension)
Description copied from class:BuilderBase
Preload operation for extension, perform any data config and other operation needed for loading extension- Specified by:
preloadExtension
in classBuilderBase<Formatter.Builder>
- Parameters:
extension
- to preload
-
loadExtension
protected boolean loadExtension(@NotNull Extension extension)
Description copied from class:BuilderBase
Load extension if it is valid- Specified by:
loadExtension
in classBuilderBase<Formatter.Builder>
- Parameters:
extension
- to load- Returns:
- true if extension was loaded
-
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 Formatter.Builder htmlIdGeneratorFactory(@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 Formatter.Builder linkResolverFactory(@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
-
-