Interface RuleMessageFormatStrategy
- All Known Implementing Classes:
DefaultRuleMessageFormatStrategy
public interface RuleMessageFormatStrategy
Strategy that can be used to construct messages displayed for end users. Messages have the same format as supported
by
MessageFormat with the following exceptions:
- arguments are specified by id, not index, e.g.: {operator} or {10a05984-afef-4f8e-a3e1-3ced0783951c}
- numbers can have a multiplier, e.g.: {value,number}%
-
Method Summary
Modifier and TypeMethodDescriptionFormats a message with the given parameters and locale.format(String message, Map<String, RuleParameterData> parameters, Locale locale, RuleMessageParameterDecorator parameterDecorator) Formats a message with the given parameters and locale.
-
Method Details
-
format
Formats a message with the given parameters and locale.- Parameters:
message- - the messageparameters- - the parameterslocale- - the locale- Returns:
- the formatted message
-
format
String format(String message, Map<String, RuleParameterData> parameters, Locale locale, RuleMessageParameterDecorator parameterDecorator) Formats a message with the given parameters and locale. A parameter decorator can be used to change the message parameters after they were formatted.- Parameters:
message- - the messageparameters- - the parameterslocale- - the localeparameterDecorator- - the parameter decorator- Returns:
- the formatted message
-