Class BuilderBase<T extends BuilderBase<T>>
java.lang.Object
com.vladsch.flexmark.util.data.DataSet
com.vladsch.flexmark.util.data.MutableDataSet
com.vladsch.flexmark.util.builder.BuilderBase<T>
- All Implemented Interfaces:
DataHolder
,MutableDataHolder
,MutableDataSetter
- Direct Known Subclasses:
FlexmarkHtmlConverter.Builder
,Formatter.Builder
,HtmlRenderer.Builder
,Parser.Builder
-
Field Summary
FieldsFields inherited from interface com.vladsch.flexmark.util.data.DataHolder
NULL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addExtensionApiPoint
(@NotNull Object apiPoint) Call to add extension API point to trackabstract @NotNull Object
build()
final T
extensions
(@NotNull Collection<? extends Extension> extensions) <V> V
Deprecated.use key.get(dataHolder) instead, which will do the same thing an carries nullable information for the dataprotected abstract boolean
loadExtension
(@NotNull Extension extension) Load extension if it is validprotected void
protected abstract void
preloadExtension
(@NotNull Extension extension) Preload operation for extension, perform any data config and other operation needed for loading extensionprotected abstract void
removeApiPoint
(@NotNull Object apiPoint) Remove apiPoint from state informationstatic DataHolder
removeExtensions
(@NotNull DataHolder options, @NotNull Collection<Class<? extends Extension>> excludeExtensions) Remove given extensions from options[EXTENSIONS] data key.<V> @NotNull MutableDataSet
Tracks keys set by extension initialization<V> @NotNull MutableDataSet
set
(@NotNull NullableDataKey<V> key, V value) Store the given value for the keyMethods 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
-
Field Details
-
loadedExtensions
-
extensionApiPoints
-
currentExtension
-
-
Constructor Details
-
BuilderBase
-
BuilderBase
protected BuilderBase()
-
-
Method Details
-
removeApiPoint
Remove apiPoint from state information- Parameters:
apiPoint
- api point object
-
preloadExtension
Preload operation for extension, perform any data config and other operation needed for loading extension- Parameters:
extension
- to preload
-
loadExtension
Load extension if it is valid- Parameters:
extension
- to load- Returns:
- true if extension was loaded
-
extensions
- Parameters:
extensions
- extensions to load- Returns:
this
-
build
- Returns:
- actual instance the builder is supposed to build
-
addExtensionApiPoint
Call to add extension API point to track- Parameters:
apiPoint
- point registered
-
set
Tracks keys set by extension initialization- Specified by:
set
in interfaceMutableDataHolder
- Overrides:
set
in classMutableDataSet
- Type Parameters:
V
- data type of the data referred by the key- Parameters:
key
- data keyvalue
- value for the key- Returns:
- builder
-
set
@NotNull public <V> @NotNull MutableDataSet set(@NotNull @NotNull NullableDataKey<V> key, @Nullable V value) Description copied from interface:MutableDataHolder
Store the given value for the key- Specified by:
set
in interfaceMutableDataHolder
- Overrides:
set
in classMutableDataSet
- Type Parameters:
V
- data type of the data referred by the key- Parameters:
key
- data keyvalue
- value to store- Returns:
- mutable data holder for chained calls
-
get
Deprecated.use key.get(dataHolder) instead, which will do the same thing an carries nullable information for the dataGet the given key, if it does not exist then use the key's factory to create a new value and put it into the collection so that the following get of the same key will find a value- Type Parameters:
V
- Type returned by key- Parameters:
key
- data key- Returns:
- return stored value or newly created value
-
loadExtensions
protected void loadExtensions() -
removeExtensions
public static DataHolder removeExtensions(@NotNull @NotNull DataHolder options, @NotNull @NotNull Collection<Class<? extends Extension>> excludeExtensions) Remove given extensions from options[EXTENSIONS] data key.- Parameters:
options
- options where EXTENSIONS key is setexcludeExtensions
- collection of extension classes to remove from extensions- Returns:
- modified options if removed and options were immutable or the same options if nothing to remove or options were mutable.
-