Class TextContentRenderer.Builder

java.lang.Object
org.commonmark.renderer.text.TextContentRenderer.Builder
Enclosing class:
TextContentRenderer

public static class TextContentRenderer.Builder extends Object
Builder for configuring a TextContentRenderer. See methods for default configuration.
  • Field Details

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public TextContentRenderer build()
      Returns:
      the configured TextContentRenderer
    • stripNewlines

      public TextContentRenderer.Builder stripNewlines(boolean stripNewlines)
      Set the value of flag for stripping new lines.
      Parameters:
      stripNewlines - true for stripping new lines and render text as "single line", false for keeping all line breaks
      Returns:
      this
    • nodeRendererFactory

      public TextContentRenderer.Builder nodeRendererFactory(TextContentNodeRendererFactory nodeRendererFactory)
      Add a factory for instantiating a node renderer (done when rendering). This allows to override the rendering of node types or define rendering for custom node types.

      If multiple node renderers for the same node type are created, the one from the factory that was added first "wins". (This is how the rendering for core node types can be overridden; the default rendering comes last.)

      Parameters:
      nodeRendererFactory - the factory for creating a node renderer
      Returns:
      this
    • extensions

      public TextContentRenderer.Builder extensions(Iterable<? extends Extension> extensions)
      Parameters:
      extensions - extensions to use on this text content renderer
      Returns:
      this