Class TextContentRenderer.Builder

  • Enclosing class:
    TextContentRenderer

    public static class TextContentRenderer.Builder
    extends java.lang.Object
    Builder for configuring a TextContentRenderer. See methods for default configuration.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • 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​(java.lang.Iterable<? extends Extension> extensions)
        Parameters:
        extensions - extensions to use on this text content renderer
        Returns:
        this