Class TextElement

java.lang.Object
ai.dat.core.configuration.description.TextElement
All Implemented Interfaces:
BlockElement, InlineElement

public class TextElement extends Object implements BlockElement, InlineElement
Represents a text block in the Description.
  • Method Details

    • text

      public static TextElement text(String format, InlineElement... elements)
      Creates a block of text with placeholders ("%s") that will be replaced with proper string representation of given InlineElement. For example:

      text("This is a text with a link %s", link("https://somepage", "to here"))

      Parameters:
      format - text with placeholders for elements
      elements - elements to be put in the text
      Returns:
      block of text
    • text

      public static TextElement text(String text)
      Creates a simple block of text.
      Parameters:
      text - a simple block of text
      Returns:
      block of text
    • wrap

      public static InlineElement wrap(InlineElement... elements)
      Wraps a list of InlineElements into a single TextElement.
    • code

      public static TextElement code(String text)
      Creates a block of text formatted as code.
      Parameters:
      text - a block of text that will be formatted as code
      Returns:
      block of text formatted as code
    • getStyles

      public EnumSet<TextElement.TextStyle> getStyles()
    • format

      public void format(Formatter formatter)