Class TextNode

java.lang.Object
io.mindspice.simplypages.components.TextNode
All Implemented Interfaces:
Component

public class TextNode extends Object implements Component
Plain text component that always HTML-escapes output.

Immutable and thread-safe after construction.

  • Constructor Details

    • TextNode

      public TextNode(String text)
      Creates a text node.
      Parameters:
      text - untrusted or trusted text content
  • Method Details

    • create

      public static TextNode create(String text)
      Creates a text node.
      Parameters:
      text - text content
      Returns:
      new text node
    • render

      public String render(RenderContext context)
      Renders escaped HTML text.
      Specified by:
      render in interface Component
      Parameters:
      context - context used for slot resolution and render policy
      Returns:
      escaped text