Interface StringRenderable

  • All Known Subinterfaces:
    HtmlRenderable, PlainTextRenderable
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface StringRenderable
    The role of an object that can be rendered into a String as HTML markup.
    Author:
    Fabrizio Giudici
    Stereotype:
    Role
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.lang.String render​(java.lang.Object... args)
      Renders the attached object into a String.
      default void renderTo​(java.io.PrintWriter printWriter, java.lang.Object... args)
      Renders the attached object printing to a PrintWriter.
      default void renderTo​(java.lang.StringBuilder stringBuilder, java.lang.Object... args)
      Renders the attached object appending to a StringBuilder.
    • Field Detail

      • _StringRenderable_

        static final java.lang.Class<StringRenderable> _StringRenderable_
    • Method Detail

      • render

        @Nonnull
        java.lang.String render​(@Nonnull
                                java.lang.Object... args)
        Renders the attached object into a String. The method accepts optional parameters that can be used to control the format of the rendering; they are usually specific of the object attached to this role.
        Parameters:
        args - optional rendering parameters
        Returns:
        the string
      • renderTo

        default void renderTo​(@Nonnull
                              java.lang.StringBuilder stringBuilder,
                              @Nonnull
                              java.lang.Object... args)
        Renders the attached object appending to a StringBuilder. The method accepts optional parameters that can be used to control the format of the rendering; they are usually specific of the object attached to this role.
        Parameters:
        stringBuilder - the StringBuilder to append to
        args - optional rendering parameters
      • renderTo

        default void renderTo​(@Nonnull
                              java.io.PrintWriter printWriter,
                              @Nonnull
                              java.lang.Object... args)
        Renders the attached object printing to a PrintWriter. The method accepts optional parameters that can be used to control the format of the rendering; they are usually specific of the object attached to this role.
        Parameters:
        printWriter - the PrintWriter to print to
        args - optional rendering parameters