public class CachedMessageSource extends org.springframework.context.support.AbstractMessageSource implements MutableMessageSource
Constructor and Description |
---|
CachedMessageSource() |
Modifier and Type | Method and Description |
---|---|
void |
addPresentation(PresentationMessage message)
Adds a presentation message to the source.
|
Collection<Locale> |
getLocales()
Gets the locales for which messages are available from this source.
|
PresentationMessage |
getPresentation(String key,
Locale forLocale)
Gets the PresentationMessage for a particular locale.
|
Collection<PresentationMessage> |
getPresentations()
Gets all of the available messages, packaged as PresentationMessages.
|
Collection<PresentationMessage> |
getPresentationsInLocale(Locale locale)
Gets alll the available messages in a particular locale, packaged as PresentationMessages.
|
void |
merge(MutableMessageSource fromSource,
boolean overwrite)
Merge messages from another source into this source.
|
void |
removePresentation(PresentationMessage message)
Removes a presentation message from the source.
|
protected MessageFormat |
resolveCode(String code,
Locale locale) |
getCommonMessages, getDefaultMessage, getDefaultMessage, getMessage, getMessage, getMessage, getMessageFromParent, getMessageInternal, getParentMessageSource, isUseCodeAsDefaultMessage, resolveArguments, resolveCodeWithoutArguments, setCommonMessages, setParentMessageSource, setUseCodeAsDefaultMessage
createMessageFormat, formatMessage, isAlwaysUseMessageFormat, renderDefaultMessage, setAlwaysUseMessageFormat
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void addPresentation(PresentationMessage message)
MutableMessageSource
addPresentation
in interface MutableMessageSource
message
- message to add to the sourcepublic Collection<Locale> getLocales()
MutableMessageSource
getLocales
in interface MutableMessageSource
Should should be able to contain multiple locales
public Collection<PresentationMessage> getPresentations()
MutableMessageSource
getPresentations
in interface MutableMessageSource
public void removePresentation(PresentationMessage message)
MutableMessageSource
removePresentation
in interface MutableMessageSource
message
- the message to removepublic void merge(MutableMessageSource fromSource, boolean overwrite)
MutableMessageSource
merge
in interface MutableMessageSource
fromSource
- message source from which messages should be mergeoverwrite
- whether to overwrite existing messagespublic PresentationMessage getPresentation(String key, Locale forLocale)
MutableMessageSource
getPresentation
in interface MutableMessageSource
key
- textual key for the messageforLocale
- locale for which to get the messageShould match get message with presentation message
public Collection<PresentationMessage> getPresentationsInLocale(Locale locale)
MutableMessageSource
getPresentationsInLocale
in interface MutableMessageSource
locale
- locale for which to get the messagesMutableMessageSource.getPresentationsInLocale(java.util.Locale)
protected MessageFormat resolveCode(String code, Locale locale)
resolveCode
in class org.springframework.context.support.AbstractMessageSource
AbstractMessageSource.resolveCode(java.lang.String,
java.util.Locale)
Copyright © 2024 OpenMRS Inc.. All rights reserved.