Package io.jmix.messagetemplates.impl
Class MessageTemplatesGeneratorImpl.SingleTemplateGeneratorImpl
java.lang.Object
io.jmix.messagetemplates.impl.MessageTemplatesGeneratorImpl.SingleTemplateGeneratorImpl
- All Implemented Interfaces:
MessageTemplatesGenerator.SingleTemplateGenerator
- Enclosing class:
- MessageTemplatesGeneratorImpl
public class MessageTemplatesGeneratorImpl.SingleTemplateGeneratorImpl
extends Object
implements MessageTemplatesGenerator.SingleTemplateGenerator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected freemarker.template.Configurationprotected MessageTemplate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a parameter to filling the template.generate()Generates a message based on the current state of the generator.withConfiguration(freemarker.template.Configuration configuration) Sets theConfigurationfor message generation.withParams(Map<String, Object> params) Sets the parameters for filling the template.withTemplate(MessageTemplate template) Sets the template for generating the message.withTemplateCode(String templateCode) Sets the template code for generating the message.
-
Field Details
-
template
-
params
-
configuration
protected freemarker.template.Configuration configuration
-
-
Constructor Details
-
SingleTemplateGeneratorImpl
public SingleTemplateGeneratorImpl()
-
-
Method Details
-
withTemplate
Description copied from interface:MessageTemplatesGenerator.SingleTemplateGeneratorSets the template for generating the message.- Specified by:
withTemplatein interfaceMessageTemplatesGenerator.SingleTemplateGenerator- Parameters:
template- template for generating the message- Returns:
- this
-
withTemplateCode
Description copied from interface:MessageTemplatesGenerator.SingleTemplateGeneratorSets the template code for generating the message.- Specified by:
withTemplateCodein interfaceMessageTemplatesGenerator.SingleTemplateGenerator- Parameters:
templateCode- template code for generating the message- Returns:
- this
-
withConfiguration
public MessageTemplatesGenerator.SingleTemplateGenerator withConfiguration(freemarker.template.Configuration configuration) Description copied from interface:MessageTemplatesGenerator.SingleTemplateGeneratorSets theConfigurationfor message generation.- Specified by:
withConfigurationin interfaceMessageTemplatesGenerator.SingleTemplateGenerator- Parameters:
configuration- configuration for generating the message- Returns:
- this
-
withParams
Description copied from interface:MessageTemplatesGenerator.SingleTemplateGeneratorSets the parameters for filling the template.- Specified by:
withParamsin interfaceMessageTemplatesGenerator.SingleTemplateGenerator- Parameters:
params- parameters map- Returns:
- this
-
addParam
Description copied from interface:MessageTemplatesGenerator.SingleTemplateGeneratorAdds a parameter to filling the template.- Specified by:
addParamin interfaceMessageTemplatesGenerator.SingleTemplateGenerator- Parameters:
alias- parameter aliasvalue- parameter value- Returns:
- this
-
generate
Description copied from interface:MessageTemplatesGenerator.SingleTemplateGeneratorGenerates a message based on the current state of the generator.- Specified by:
generatein interfaceMessageTemplatesGenerator.SingleTemplateGenerator- Returns:
- generated message as a string
-