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.Configuration
protected 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 theConfiguration
for 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.SingleTemplateGenerator
Sets the template for generating the message.- Specified by:
withTemplate
in interfaceMessageTemplatesGenerator.SingleTemplateGenerator
- Parameters:
template
- template for generating the message- Returns:
- this
-
withTemplateCode
Description copied from interface:MessageTemplatesGenerator.SingleTemplateGenerator
Sets the template code for generating the message.- Specified by:
withTemplateCode
in 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.SingleTemplateGenerator
Sets theConfiguration
for message generation.- Specified by:
withConfiguration
in interfaceMessageTemplatesGenerator.SingleTemplateGenerator
- Parameters:
configuration
- configuration for generating the message- Returns:
- this
-
withParams
Description copied from interface:MessageTemplatesGenerator.SingleTemplateGenerator
Sets the parameters for filling the template.- Specified by:
withParams
in interfaceMessageTemplatesGenerator.SingleTemplateGenerator
- Parameters:
params
- parameters map- Returns:
- this
-
addParam
Description copied from interface:MessageTemplatesGenerator.SingleTemplateGenerator
Adds a parameter to filling the template.- Specified by:
addParam
in interfaceMessageTemplatesGenerator.SingleTemplateGenerator
- Parameters:
alias
- parameter aliasvalue
- parameter value- Returns:
- this
-
generate
Description copied from interface:MessageTemplatesGenerator.SingleTemplateGenerator
Generates a message based on the current state of the generator.- Specified by:
generate
in interfaceMessageTemplatesGenerator.SingleTemplateGenerator
- Returns:
- generated message as a string
-