Top Fields Constructors Methods
com.vladsch.flexmark.util.builder

public abstract Class BuilderBase<T extends BuilderBase<T>>

extends MutableDataSet
Class Inheritance
Imports
com.vladsch.flexmark.util.data.*, com.vladsch.flexmark.util.misc.Extension, org.jetbrains.annotations.NotNull, .Nullable, java.util.ArrayList, .Collection, .HashMap, .HashSet

Field Summary

Modifier and TypeField and Description
private Extension
private final HashMap<Class<?>, HashSet<Object>>
private final HashSet<Class<?>>

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
protected void
addExtensionApiPoint(@NotNull Object
point registered
apiPoint
)

Call to add extension API point to track

public abstract @NotNull Object

Returns:

actual instance the builder is supposed to build
build
()

public final T

Returns:

this
extensions
(@NotNull Collection<? extends Extension>
extensions to load
extensions
)

public <V> V

Returns:

return stored value or newly created value
get
(@NotNull DataKey<V>
data key
key
)
Deprecated use key.get(dataHolder) instead, which will do the same thing an carries nullable information for the data

Get 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

protected abstract boolean

Returns:

true if extension was loaded
loadExtension
(@NotNull Extension
to load
extension
)

Load extension if it is valid

protected void
protected abstract void
preloadExtension(@NotNull Extension
to preload
extension
)

Preload operation for extension, perform any data config and other operation needed for loading extension

protected abstract void
removeApiPoint(@NotNull Object
api point object
apiPoint
)

Remove apiPoint from state information

public static DataHolder

Returns:

modified options if removed and options were immutable or the same options if nothing to remove or options were mutable.
removeExtensions
(@NotNull DataHolder
options where EXTENSIONS key is set
options
,
@NotNull Collection<Class<? extends Extension>>
collection of extension classes to remove from extensions
excludeExtensions
)

Remove given extensions from options[EXTENSIONS] data key.

public <V> @NotNull MutableDataSet

Returns:

builder
set
(@NotNull DataKey<V>
data key
key
,
V
value for the key
value
)

Tracks keys set by extension initialization

public <V> @NotNull MutableDataSet
set(@NotNull NullableDataKey<V> key, V value)

Inherited from com.vladsch.flexmark.util.data.MutableDataSet:
cleargetOrComputemergeremovesetsetsetAllsetFromsetIntoDataSettoImmutabletoMutable

Field Detail

currentExtensionback to summary
private Extension currentExtension
extensionApiPointsback to summary
private final HashMap<Class<?>, HashSet<Object>> extensionApiPoints
loadedExtensionsback to summary
private final HashSet<Class<?>> loadedExtensions

Constructor Detail

BuilderBaseback to summary
protected BuilderBase(@Nullable DataHolder options)
BuilderBaseback to summary
protected BuilderBase()

Method Detail

addExtensionApiPointback to summary
protected void addExtensionApiPoint(@NotNull Object apiPoint)

Call to add extension API point to track

Parameters
apiPoint:@NotNull Object

point registered

buildback to summary
public abstract @NotNull Object build()
Returns:@NotNull Object

actual instance the builder is supposed to build

Annotations
@NotNull
extensionsback to summary
public final T extensions(@NotNull Collection<? extends Extension> extensions)
Parameters
extensions:@NotNull Collection<? extends Extension>

extensions to load

Returns:T

this

Annotations
@NotNull
getback to summary
public <V> V get(@NotNull DataKey<V> key)

Deprecated

use key.get(dataHolder) instead, which will do the same thing an carries nullable information for the data

Get 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

Parameters
key:@NotNull DataKey<V>

data key

Returns:V

return stored value or newly created value

Annotations
@Deprecated
@Override
loadExtensionback to summary
protected abstract boolean loadExtension(@NotNull Extension extension)

Load extension if it is valid

Parameters
extension:@NotNull Extension

to load

Returns:boolean

true if extension was loaded

loadExtensionsback to summary
protected void loadExtensions()
preloadExtensionback to summary
protected abstract void preloadExtension(@NotNull Extension extension)

Preload operation for extension, perform any data config and other operation needed for loading extension

Parameters
extension:@NotNull Extension

to preload

removeApiPointback to summary
protected abstract void removeApiPoint(@NotNull Object apiPoint)

Remove apiPoint from state information

Parameters
apiPoint:@NotNull Object

api point object

removeExtensionsback to summary
public static DataHolder removeExtensions(@NotNull DataHolder options, @NotNull Collection<Class<? extends Extension>> excludeExtensions)

Remove given extensions from options[EXTENSIONS] data key.

Parameters
options:@NotNull DataHolder

options where EXTENSIONS key is set

excludeExtensions:@NotNull Collection<Class<? extends Extension>>

collection of extension classes to remove from extensions

Returns:DataHolder

modified options if removed and options were immutable or the same options if nothing to remove or options were mutable.

setback to summary
public <V> @NotNull MutableDataSet set(@NotNull DataKey<V> key, V value)

Tracks keys set by extension initialization

Parameters
key:@NotNull DataKey<V>

data key

value:V

value for the key

Returns:@NotNull MutableDataSet

builder

Annotations
@NotNull
@Override
setback to summary
public <V> @NotNull MutableDataSet set(@NotNull NullableDataKey<V> key, V value)
Annotations
@NotNull
@Override