public class DefaultMessageSourceServiceImpl extends Object implements MessageSourceService
| Modifier and Type | Method and Description |
|---|---|
void |
addPresentation(PresentationMessage message)
Adds a presentation message to the source.
|
MutableMessageSource |
getActiveMessageSource()
Gets the message source service which is currently providing services.
|
static DefaultMessageSourceServiceImpl |
getInstance()
Get the static/singular instance
|
Collection<Locale> |
getLocales()
Gets the locales for which messages are available from this source.
|
String |
getMessage(org.springframework.context.MessageSourceResolvable resolvable,
Locale locale) |
String |
getMessage(String s)
Get the message with the given code from the current user's selected locale.
|
String |
getMessage(String code,
Object[] args,
Locale locale) |
String |
getMessage(String code,
Object[] args,
String defaultMessage,
Locale locale) |
Set<MutableMessageSource> |
getMessageSources() |
org.springframework.context.MessageSource |
getParentMessageSource() |
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.
|
void |
setActiveMessageSource(MutableMessageSource activeMessageSource)
Sets the message source service which will actually provide services.
|
void |
setMessageSources(Set<MutableMessageSource> availableMessageSources) |
void |
setParentMessageSource(org.springframework.context.MessageSource parent) |
public static DefaultMessageSourceServiceImpl getInstance()
public String getMessage(String code, Object[] args, String defaultMessage, Locale locale)
getMessage in interface org.springframework.context.MessageSourcepublic String getMessage(String code, Object[] args, Locale locale) throws org.springframework.context.NoSuchMessageException
getMessage in interface org.springframework.context.MessageSourceorg.springframework.context.NoSuchMessageExceptionpublic String getMessage(String s)
MessageSourceServicegetMessage in interface MessageSourceServices - message code to retrieveMessageSource.getMessage(String arg0, Object[] arg1, java.util.Locale arg2)public Collection<Locale> getLocales()
MutableMessageSourcegetLocales in interface MutableMessageSourcepublic Collection<PresentationMessage> getPresentations()
MutableMessageSourcegetPresentations in interface MutableMessageSourcepublic Collection<PresentationMessage> getPresentationsInLocale(Locale locale)
MutableMessageSourcegetPresentationsInLocale in interface MutableMessageSourcelocale - locale for which to get the messagespublic void addPresentation(PresentationMessage message)
MutableMessageSourceaddPresentation in interface MutableMessageSourcemessage - message to add to the sourcepublic PresentationMessage getPresentation(String key, Locale forLocale)
MutableMessageSourcegetPresentation in interface MutableMessageSourcekey - textual key for the messageforLocale - locale for which to get the messagepublic void removePresentation(PresentationMessage message)
MutableMessageSourceremovePresentation in interface MutableMessageSourcemessage - the message to removepublic void merge(MutableMessageSource fromSource, boolean overwrite)
MutableMessageSourcemerge in interface MutableMessageSourcefromSource - message source from which messages should be mergeoverwrite - whether to overwrite existing messagespublic String getMessage(org.springframework.context.MessageSourceResolvable resolvable, Locale locale) throws org.springframework.context.NoSuchMessageException
getMessage in interface org.springframework.context.MessageSourceorg.springframework.context.NoSuchMessageExceptionpublic void setParentMessageSource(org.springframework.context.MessageSource parent)
setParentMessageSource in interface org.springframework.context.HierarchicalMessageSourcepublic org.springframework.context.MessageSource getParentMessageSource()
getParentMessageSource in interface org.springframework.context.HierarchicalMessageSourcepublic MutableMessageSource getActiveMessageSource()
MessageSourceServicegetActiveMessageSource in interface MessageSourceServicepublic void setActiveMessageSource(MutableMessageSource activeMessageSource)
MessageSourceServicesetActiveMessageSource in interface MessageSourceServiceactiveMessageSource - the MutableMessageSource to setpublic Set<MutableMessageSource> getMessageSources()
getMessageSources in interface MessageSourceServicepublic void setMessageSources(Set<MutableMessageSource> availableMessageSources)
setMessageSources in interface MessageSourceServiceavailableMessageSources - the availableMessageSources to setCopyright © 2024 OpenMRS Inc.. All rights reserved.