Package org.apereo.cas.web.view
Class CasReloadableMessageBundle
- java.lang.Object
-
- org.springframework.context.support.MessageSourceSupport
-
- org.springframework.context.support.AbstractMessageSource
-
- org.springframework.context.support.AbstractResourceBasedMessageSource
-
- org.springframework.context.support.ReloadableResourceBundleMessageSource
-
- org.apereo.cas.web.view.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.ReloadableResourceBundleMessageSourceAn extension of theReloadableResourceBundleMessageSourcewhose 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, andAbstractMessageSource.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. IfAbstractMessageSource.setUseCodeAsDefaultMessage(boolean)is set to false, only then anullvalue will be returned, which subsequently causes an instance ofNoSuchMessageExceptionto be thrown.- Since:
- 4.0.0
-
-
Constructor Summary
Constructors Constructor Description CasReloadableMessageBundle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetDefaultMessage(java.lang.String code)protected java.lang.StringgetMessageInternal(java.lang.String code, java.lang.Object[] args, java.util.Locale locale)voidsetBasenames(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
-
-
-
-
Method Detail
-
getDefaultMessage
protected java.lang.String getDefaultMessage(java.lang.String code)
- Overrides:
getDefaultMessagein classorg.springframework.context.support.AbstractMessageSource
-
getMessageInternal
protected java.lang.String getMessageInternal(java.lang.String code, java.lang.Object[] args, java.util.Locale locale)- Overrides:
getMessageInternalin classorg.springframework.context.support.AbstractMessageSource
-
setBasenames
public void setBasenames(java.lang.String... basenames)
- Overrides:
setBasenamesin classorg.springframework.context.support.AbstractResourceBasedMessageSource
-
-