Package sonia.scm.cli

Class TemplateRenderer

java.lang.Object
sonia.scm.cli.TemplateRenderer

public class TemplateRenderer extends Object
This is the default template renderer which should be used to write templated content to the channels of the CLI connection.
Since:
2.33.0
  • Constructor Details

  • Method Details

    • renderToStdout

      public void renderToStdout(String template, Map<String,Object> model)
      Writes templated content to the stdout channel
      Parameters:
      template - the mustache template
      model - the model which should be used for templating
    • renderToStderr

      public void renderToStderr(String template, Map<String,Object> model)
      Writes templated content to the stderr channel
      Parameters:
      template - the mustache template
      model - the model which should be used for templating
    • renderDefaultError

      public void renderDefaultError(String error)
      Writes an error to the stderr channel using the default error template
      Parameters:
      error - the error which should be used for templating
    • renderDefaultError

      public void renderDefaultError(Exception exception)
      Writes the exception message to the stderr channel using the default error template
      Parameters:
      exception - the exception which should be used for templating
    • createTable

      public Table createTable()
      Creates the table which should be used to template table-like content.
      Returns:
      table for templating content
    • getContext

      protected CliContext getContext()
    • getBundle

      protected ResourceBundle getBundle()