Class CasReloadableMessageBundle

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.HierarchicalMessageSource, org.springframework.context.MessageSource, org.springframework.context.ResourceLoaderAware

    public class CasReloadableMessageBundle
    extends org.springframework.context.support.ReloadableResourceBundleMessageSource
    An extension of the ReloadableResourceBundleMessageSource whose sole concern is to print a WARN message in cases where a language key is not found in the active and default bundles.

    Note: By default, if a key not found in a localized bundle, Spring will auto-fallback to the default bundle that is messages.properties. However, if the key is also not found in the default bundle, and AbstractMessageSource.setUseCodeAsDefaultMessage(boolean) is set to true, then only the requested code itself will be used as the message to display. In this case, the class will issue a WARN message instructing the caller that the bundle needs further attention. If AbstractMessageSource.setUseCodeAsDefaultMessage(boolean) is set to false, only then a null value will be returned, which subsequently causes an instance of NoSuchMessageException to be thrown.

    Since:
    4.0.0
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.springframework.context.support.ReloadableResourceBundleMessageSource

        org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
    • Field Summary

      • Fields inherited from class org.springframework.context.support.MessageSourceSupport

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String getDefaultMessage​(java.lang.String code)  
      protected java.lang.String getMessageInternal​(java.lang.String code, java.lang.Object[] args, java.util.Locale locale)  
      void setBasenames​(java.lang.String... basenames)  
      • Methods inherited from class org.springframework.context.support.ReloadableResourceBundleMessageSource

        calculateAllFilenames, calculateFilenamesForLocale, clearCache, clearCacheIncludingAncestors, getMergedProperties, getProperties, loadProperties, newProperties, refreshProperties, resolveCode, resolveCodeWithoutArguments, setConcurrentRefresh, setFileEncodings, setPropertiesPersister, setResourceLoader, toString
      • Methods inherited from class org.springframework.context.support.AbstractResourceBasedMessageSource

        addBasenames, getBasenameSet, getCacheMillis, getDefaultEncoding, getDefaultLocale, isFallbackToSystemLocale, setBasename, setCacheMillis, setCacheSeconds, setDefaultEncoding, setDefaultLocale, setFallbackToSystemLocale
      • Methods inherited from class org.springframework.context.support.AbstractMessageSource

        getCommonMessages, getDefaultMessage, getMessage, getMessage, getMessage, getMessageFromParent, getParentMessageSource, isUseCodeAsDefaultMessage, resolveArguments, setCommonMessages, setParentMessageSource, setUseCodeAsDefaultMessage
      • Methods inherited from class org.springframework.context.support.MessageSourceSupport

        createMessageFormat, formatMessage, isAlwaysUseMessageFormat, renderDefaultMessage, setAlwaysUseMessageFormat
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CasReloadableMessageBundle

        public CasReloadableMessageBundle()
    • Method Detail

      • getDefaultMessage

        protected java.lang.String getDefaultMessage​(java.lang.String code)
        Overrides:
        getDefaultMessage in class org.springframework.context.support.AbstractMessageSource
      • getMessageInternal

        protected java.lang.String getMessageInternal​(java.lang.String code,
                                                      java.lang.Object[] args,
                                                      java.util.Locale locale)
        Overrides:
        getMessageInternal in class org.springframework.context.support.AbstractMessageSource
      • setBasenames

        public void setBasenames​(java.lang.String... basenames)
        Overrides:
        setBasenames in class org.springframework.context.support.AbstractResourceBasedMessageSource