Package io.jmix.messagetemplates
Interface MessageTemplatesGenerator.MultiTemplateGenerator
- All Known Implementing Classes:
MessageTemplatesGeneratorImpl.MultiTemplateGeneratorImpl
- Enclosing interface:
- MessageTemplatesGenerator
public static interface MessageTemplatesGenerator.MultiTemplateGenerator
The generator is used to create messages based on a multiple set of templates and a single map of parameters.
The result of the generation is a list of templates filled with passed parameters.
-
Method Summary
Modifier and TypeMethodDescriptionAdds a parameter to filling the templates.generate()
Generates a messages based on the current state of the generator.withConfiguration
(freemarker.template.Configuration configuration) Sets theConfiguration
for message generation.withParams
(Map<String, Object> params) Sets the parameters for filling the templates.withTemplateCodes
(String... templateCodes) Sets the template codes for generating the messages.withTemplates
(MessageTemplate... templates) Sets the templates for generating the messages.
-
Method Details
-
withTemplates
Sets the templates for generating the messages.- Parameters:
templates
- array ofMessageTemplate
for generating the message.- Returns:
- this
-
withTemplateCodes
Sets the template codes for generating the messages.- Parameters:
templateCodes
- array ofMessageTemplate
codes for generating the message- Returns:
- this
-
withConfiguration
MessageTemplatesGenerator.MultiTemplateGenerator withConfiguration(freemarker.template.Configuration configuration) Sets theConfiguration
for message generation.- Parameters:
configuration
- configuration for generating the message- Returns:
- this
-
withParams
Sets the parameters for filling the templates.- Parameters:
params
- parameters map- Returns:
- this
-
addParam
Adds a parameter to filling the templates.- Parameters:
alias
- parameter aliasvalue
- parameter value- Returns:
- this
-
generate
Generates a messages based on the current state of the generator.- Returns:
- generated messages as a list of strings
-