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
Builder for configuring an
Formatter. See methods for default configuration.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) List<AttributeProviderFactory> (package private) HeaderIdGeneratorFactory(package private) List<LinkResolverFactory> (package private) List<NodeFormatterFactory> Fields inherited from interface DataHolder
NULL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Formatterbuild()@NotNull Formatter.BuilderhtmlIdGeneratorFactory(@NotNull HeaderIdGeneratorFactory htmlIdGeneratorFactory) Add a factory for generating the header id attribute from the header's text@NotNull Formatter.BuilderlinkResolverFactory(@NotNull LinkResolverFactory linkResolverFactory) Add a factory for instantiating a node renderer (done when rendering).protected booleanloadExtension(@NotNull Extension extension) Load extension if it is validnodeFormatterFactory(NodeFormatterFactory nodeFormatterFactory) Add a factory for instantiating a node renderer (done when rendering).protected voidpreloadExtension(@NotNull Extension extension) Preload operation for extension, perform any data config and other operation needed for loading extensionprotected voidremoveApiPoint(@NotNull Object apiPoint) Remove apiPoint from state informationMethods inherited from class BuilderBase
addExtensionApiPoint, extensions, get, loadExtensions, removeExtensions, set, setMethods inherited from class MutableDataSet
clear, getOrCompute, merge, remove, setAll, setFrom, setIn, toDataSet, toImmutable, toMutableMethods inherited from class DataSet
aggregate, aggregate, aggregateActions, contains, equals, getAll, getKeys, hashCode, registerDataKeyAggregator, toStringMethods inherited from interface DataHolder
contains, getAll, getKeys
-
Field Details
-
attributeProviderFactories
List<AttributeProviderFactory> attributeProviderFactories -
nodeFormatterFactories
List<NodeFormatterFactory> nodeFormatterFactories -
linkResolverFactories
List<LinkResolverFactory> linkResolverFactories -
htmlIdGeneratorFactory
HeaderIdGeneratorFactory htmlIdGeneratorFactory
-
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
build
- Specified by:
buildin classBuilderBase<Formatter.Builder>- Returns:
- the configured
Formatter
-
removeApiPoint
Description copied from class:BuilderBaseRemove apiPoint from state information- Specified by:
removeApiPointin classBuilderBase<Formatter.Builder>- Parameters:
apiPoint- api point object
-
preloadExtension
Description copied from class:BuilderBasePreload operation for extension, perform any data config and other operation needed for loading extension- Specified by:
preloadExtensionin classBuilderBase<Formatter.Builder>- Parameters:
extension- to preload
-
loadExtension
Description copied from class:BuilderBaseLoad extension if it is valid- Specified by:
loadExtensionin classBuilderBase<Formatter.Builder>- Parameters:
extension- to load- Returns:
- true if extension was loaded
-
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
-