- All Implemented Interfaces:
freemarker.template.TemplateMethodModel, freemarker.template.TemplateMethodModelEx, freemarker.template.TemplateModel, freemarker.template.TemplateScalarModel
public class I18nStringTemplateModel
extends Object
implements freemarker.template.TemplateMethodModelEx, freemarker.template.TemplateScalarModel
A Freemarker representation of a text string. Because it implements
TemplateScalarModel, you can use it as a string value. And because it
implements TemplateMethodModel, you can pass arguments to it for formatting.
So if the string is "His name is {0}!", then these references could be used:
${string} ==> "His name is {0}!"
${string("Bozo")} ==> "His name is Bozo!"
Note that the format of the message is determined by java.text.MessageFormat,
so argument indices start at 0 and you can escape a substring by wrapping it
in apostrophes.