Class HtmlTextBuilder<T extends HtmlTextBuilder>

  • All Implemented Interfaces:
    TextBuilder<T>
    Direct Known Subclasses:
    ColoredHtmlTextBuilder

    @OpenApiAll
    public class HtmlTextBuilder<T extends HtmlTextBuilder>
    extends AbstractTextBuilder<T>
    A builder used for html text building. Plain or rich text fragments will be transformed to html text. Colored fragments are not supported.
    • Field Detail

      • preferLightHtml

        private boolean preferLightHtml
      • hasLightHtml

        private java.lang.Boolean hasLightHtml
      • hasFullHtml

        private java.lang.Boolean hasFullHtml
    • Constructor Detail

      • HtmlTextBuilder

        public HtmlTextBuilder()
    • Method Detail

      • markAsLightHtml

        private void markAsLightHtml​(boolean lightHtml)
      • prependWithNoWrap

        public T prependWithNoWrap​(java.lang.CharSequence plainText)
        Description copied from interface: TextBuilder
        Add text to the beginning. Added text will not be wrapped if builder supports that.
        Parameters:
        plainText - text to prepend
        Returns:
        this builder
      • appendWithNoWrap

        public T appendWithNoWrap​(java.lang.CharSequence text)
        Description copied from interface: TextBuilder
        Append text from the given builder. Added text will not be wrapped if builder supports that.
        Parameters:
        text - text to prepend
        Returns:
        this builder
      • replaceSpaceToNbsp

        public java.lang.String replaceSpaceToNbsp​(java.lang.String text)
      • toPlainText

        public java.lang.String toPlainText()
        Returns:
        result string as plain text
      • hasLightHtml

        private boolean hasLightHtml()
      • hasFullHtml

        private boolean hasFullHtml()
      • createHtmlTextBuilderPreferLightHtml

        public static HtmlTextBuilder createHtmlTextBuilderPreferLightHtml()
        Creates and instance of builder which outputs light html if full html was not appended.
        Returns:
        builder
      • preferLightHtml

        protected void preferLightHtml​(HtmlTextBuilder builder)