Package icyllis.modernui.markflow
Class MarkflowConfig.Builder
java.lang.Object
icyllis.modernui.markflow.MarkflowConfig.Builder
- Enclosing class:
MarkflowConfig
-
Method Summary
Modifier and TypeMethodDescription<N extends org.commonmark.node.Node>
MarkflowConfig.BuilderappendSpanFactory
(Class<? extends N> clazz, SpanFactory<? super N> factory) Append a factory to existing one (or make the first one for specified node).build
(MarkflowTheme theme) Build the instance, and this builder cannot be reused.<N extends org.commonmark.node.Node>
SpanFactory<N> getSpanFactory
(Class<N> node) Can be useful when enhancing an already defined SpanFactory with another one.<N extends org.commonmark.node.Node>
MarkflowConfig.BuilderprependSpanFactory
(Class<? extends N> clazz, SpanFactory<? super N> factory) Prepend a factory to existing one (or make the first one for specified node).<N extends org.commonmark.node.Node>
MarkflowConfig.BuildersetSpanFactory
(Class<? extends N> clazz, SpanFactory<? super N> factory) Replace/remove the span factory for the given type.
-
Method Details
-
setSpanFactory
@NonNull public <N extends org.commonmark.node.Node> MarkflowConfig.Builder setSpanFactory(@NonNull Class<? extends N> clazz, @Nullable SpanFactory<? super N> factory) Replace/remove the span factory for the given type.- Parameters:
clazz
- node typefactory
- span factory- Returns:
- this
-
appendSpanFactory
@NonNull public <N extends org.commonmark.node.Node> MarkflowConfig.Builder appendSpanFactory(@NonNull Class<? extends N> clazz, @NonNull SpanFactory<? super N> factory) Append a factory to existing one (or make the first one for specified node). Specified factory will be called after original (if present) factory. Can be used to change behavior or original span factory.- Parameters:
clazz
- node typefactory
- span factory- Returns:
- this
-
prependSpanFactory
@NonNull public <N extends org.commonmark.node.Node> MarkflowConfig.Builder prependSpanFactory(@NonNull Class<? extends N> clazz, @NonNull SpanFactory<? super N> factory) Prepend a factory to existing one (or make the first one for specified node). Specified factory will be calledbefore original (if present) factory.- Parameters:
clazz
- node typefactory
- span factory- Returns:
- this
-
getSpanFactory
@Nullable public <N extends org.commonmark.node.Node> SpanFactory<N> getSpanFactory(@NonNull Class<N> node) Can be useful when enhancing an already defined SpanFactory with another one. -
build
Build the instance, and this builder cannot be reused.
-