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,percent*1}
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String format​(java.lang.String message, java.util.Map<java.lang.String,​RuleParameterData> parameters, java.util.Locale locale)
      Formats a message with the given parameters and locale.
      java.lang.String format​(java.lang.String message, java.util.Map<java.lang.String,​RuleParameterData> parameters, java.util.Locale locale, RuleMessageParameterDecorator parameterDecorator)
      Formats a message with the given parameters and locale.
    • Method Detail

      • format

        java.lang.String format​(java.lang.String message,
                                java.util.Map<java.lang.String,​RuleParameterData> parameters,
                                java.util.Locale locale)
        Formats a message with the given parameters and locale.
        Parameters:
        message - - the message
        parameters - - the parameters
        locale - - the locale
        Returns:
        the formatted message
      • format

        java.lang.String format​(java.lang.String message,
                                java.util.Map<java.lang.String,​RuleParameterData> parameters,
                                java.util.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 message
        parameters - - the parameters
        locale - - the locale
        parameterDecorator - - the parameter decorator
        Returns:
        the formatted message