Class MarkdownConfig.Builder

java.lang.Object
icyllis.modernui.markdown.MarkdownConfig.Builder
Enclosing class:
MarkdownConfig

public static final class MarkdownConfig.Builder extends Object
  • Method Details

    • addVisitor

      @NonNull public <N extends com.vladsch.flexmark.util.ast.Node> MarkdownConfig.Builder addVisitor(@NonNull Class<? extends N> clazz, @Nullable NodeVisitor<? super N> visitor)
      Override any existing visitor for the given type.
      Parameters:
      clazz - node type (exact class)
      visitor - NodeVisitor to be used, null to remove existing
      Returns:
      this
    • setSpanFactory

      @NonNull public <N extends com.vladsch.flexmark.util.ast.Node> MarkdownConfig.Builder setSpanFactory(@NonNull Class<? extends N> clazz, @Nullable SpanFactory<? super N> factory)
    • appendSpanFactory

      @NonNull public <N extends com.vladsch.flexmark.util.ast.Node> MarkdownConfig.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 com.vladsch.flexmark.util.ast.Node> MarkdownConfig.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 com.vladsch.flexmark.util.ast.Node> SpanFactory<N> getSpanFactory(@NonNull Class<N> node)
      Can be useful when enhancing an already defined SpanFactory with another one.
    • setBlockHandler

      @NonNull public MarkdownConfig.Builder setBlockHandler(@Nullable BlockHandler blockHandler)
      Parameters:
      blockHandler - to handle block start/end
      Returns:
      this
    • build

      @NonNull public MarkdownConfig build(MarkdownTheme theme)