Class ResourceBundleMessageSource

    • Constructor Detail

      • ResourceBundleMessageSource

        public ResourceBundleMessageSource​(String... baseName)
    • Method Detail

      • getMessage

        public String getMessage​(String key,
                                 Supplier<String> defaultMessage,
                                 Locale locale,
                                 Object... arguments)
        Description copied from interface: MessageSource
        Gets the message.
        Specified by:
        getMessage in interface MessageSource
        Parameters:
        key - to look up the message
        defaultMessage - the default message
        locale - the locale to use
        arguments - the message arguments
        Returns:
        the message
      • getMessageFromCache

        protected String getMessageFromCache​(Locale locale,
                                             String key)
        Gets the message from cache or the resource bundles. Returns an empty string if not found.
        Parameters:
        locale - the locale
        key - the message key
        Returns:
        the message
      • resolveMessage

        protected String resolveMessage​(Locale locale,
                                        String key)
        Gets the message from the resource bundles. Returns an empty string if not found.
        Parameters:
        locale - the locale
        key - the message key
        Returns:
        the message