Class MarkflowConfig.Builder

java.lang.Object
icyllis.modernui.markflow.MarkflowConfig.Builder
Enclosing class:
MarkflowConfig

public static final class MarkflowConfig.Builder extends Object
  • 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 type
      factory - 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 type
      factory - 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 called before original (if present) factory.
      Parameters:
      clazz - node type
      factory - 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.