Package sonia.scm.cli
Class TemplateRenderer
java.lang.Object
sonia.scm.cli.TemplateRenderer
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 Summary
ConstructorsConstructorDescriptionTemplateRenderer
(CliContext context, TemplateEngineFactory templateEngineFactory) -
Method Summary
Modifier and TypeMethodDescriptionCreates the table which should be used to template table-like content.protected ResourceBundle
protected CliContext
void
renderDefaultError
(Exception exception) Writes the exception message to the stderr channel using the default error templatevoid
renderDefaultError
(String error) Writes an error to the stderr channel using the default error templatevoid
renderToStderr
(String template, Map<String, Object> model) Writes templated content to the stderr channelvoid
renderToStdout
(String template, Map<String, Object> model) Writes templated content to the stdout channel
-
Constructor Details
-
TemplateRenderer
-
-
Method Details
-
renderToStdout
Writes templated content to the stdout channel- Parameters:
template
- the mustache templatemodel
- the model which should be used for templating
-
renderToStderr
Writes templated content to the stderr channel- Parameters:
template
- the mustache templatemodel
- the model which should be used for templating
-
renderDefaultError
Writes an error to the stderr channel using the default error template- Parameters:
error
- the error which should be used for templating
-
renderDefaultError
Writes the exception message to the stderr channel using the default error template- Parameters:
exception
- the exception which should be used for templating
-
createTable
Creates the table which should be used to template table-like content.- Returns:
- table for templating content
-
getContext
-
getBundle
-