Class DefaultRuleMessageFormatStrategy

    • Field Detail

      • UNKNOWN_PARAMETER

        protected static final java.lang.String UNKNOWN_PARAMETER
        See Also:
        Constant Field Values
      • DEFAULT_FORMAT_STYLE

        protected static final java.lang.String DEFAULT_FORMAT_STYLE
        See Also:
        Constant Field Values
      • PARAMETER_PATTERN

        protected static final java.util.regex.Pattern PARAMETER_PATTERN
      • LIST_PATTERN

        protected static final java.util.regex.Pattern LIST_PATTERN
      • MAP_PATTERN

        protected static final java.util.regex.Pattern MAP_PATTERN
    • Constructor Detail

      • DefaultRuleMessageFormatStrategy

        public DefaultRuleMessageFormatStrategy()
    • Method Detail

      • format

        public java.lang.String format​(java.lang.String message,
                                       java.util.Map<java.lang.String,​RuleParameterData> parameters,
                                       java.util.Locale locale)
        Description copied from interface: RuleMessageFormatStrategy
        Formats a message with the given parameters and locale.
        Specified by:
        format in interface RuleMessageFormatStrategy
        Parameters:
        message - - the message
        parameters - - the parameters
        locale - - the locale
        Returns:
        the formatted message
      • format

        public java.lang.String format​(java.lang.String message,
                                       java.util.Map<java.lang.String,​RuleParameterData> parameters,
                                       java.util.Locale locale,
                                       RuleMessageParameterDecorator parameterDecorator)
        Description copied from interface: RuleMessageFormatStrategy
        Formats a message with the given parameters and locale. A parameter decorator can be used to change the message parameters after they were formatted.
        Specified by:
        format in interface RuleMessageFormatStrategy
        Parameters:
        message - - the message
        parameters - - the parameters
        locale - - the locale
        parameterDecorator - - the parameter decorator
        Returns:
        the formatted message
      • resolveValue

        protected java.lang.Object resolveValue​(RuleParameterData parameter,
                                                java.util.Locale locale)
      • sanitizeValue

        protected java.lang.Object sanitizeValue​(RuleParameterData parameter)
      • resolveFormat

        protected java.text.Format resolveFormat​(java.lang.String name,
                                                 java.lang.String arguments,
                                                 java.util.Locale locale)
      • createNumberFormat

        protected java.text.NumberFormat createNumberFormat​(java.lang.String arguments,
                                                            java.util.Locale locale)
      • createDateFormat

        protected java.text.DateFormat createDateFormat​(java.lang.String arguments,
                                                        java.util.Locale locale)
      • createTimeFormat

        protected java.text.DateFormat createTimeFormat​(java.lang.String arguments,
                                                        java.util.Locale locale)
      • decodeDateFormatStyle

        protected int decodeDateFormatStyle​(java.lang.String formatStyle)
      • createChoiceFormat

        protected java.text.NumberFormat createChoiceFormat​(java.lang.String arguments)
      • setL10NService

        public void setL10NService​(L10NService l10NService)
      • setEnumerationService

        public void setEnumerationService​(EnumerationService enumerationService)