|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openmrs.messagesource.impl.MessageSourceServiceImpl
public class MessageSourceServiceImpl
Extensible implementation of the MessageSourceService, which relies on injected implementations of MutableMessageSource to actually provide the services. The sub-services are loaded by special BeanPostProcessor handling, which looks for beans named For example: ResourceBundleMessageSourceService can be specified in the applicationContext-service.xml file to use the usual .properties files to provide messages.
| Constructor Summary | |
|---|---|
MessageSourceServiceImpl()
|
|
| Method Summary | |
|---|---|
void |
addPresentation(PresentationMessage message)
Adds a presentation message to the source. |
MutableMessageSource |
getActiveMessageSource()
Gets the message source service which is currently providing services. |
java.util.Collection<java.util.Locale> |
getLocales()
Gets the locales which are available from the current message source. |
java.lang.String |
getMessage(org.springframework.context.MessageSourceResolvable resolvable,
java.util.Locale locale)
|
java.lang.String |
getMessage(java.lang.String s)
Get the message with the given code from the current user's selected locale. |
java.lang.String |
getMessage(java.lang.String code,
java.lang.Object[] args,
java.util.Locale locale)
|
java.lang.String |
getMessage(java.lang.String code,
java.lang.Object[] args,
java.lang.String defaultMessage,
java.util.Locale locale)
|
java.util.Set<MutableMessageSource> |
getMessageSources()
|
org.springframework.context.MessageSource |
getParentMessageSource()
|
PresentationMessage |
getPresentation(java.lang.String key,
java.util.Locale forLocale)
Gets the PresentationMessage for a particular locale. |
java.util.Collection<PresentationMessage> |
getPresentations()
Returns all available messages. |
java.util.Collection<PresentationMessage> |
getPresentationsInLocale(java.util.Locale locale)
Gets alll the available messages in a particular locale, packaged as PresentationMessages. |
void |
merge(MutableMessageSource fromSource,
boolean overwrite)
Merges messages from another message source into the active (current) message source. |
void |
publishProperties(java.util.Properties props,
java.lang.String locale,
java.lang.String namespace,
java.lang.String name,
java.lang.String version)
Deprecated. use merge(MutableMessageSource, boolean) instead |
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(java.util.Set<MutableMessageSource> availableMessageSources)
|
void |
setParentMessageSource(org.springframework.context.MessageSource parent)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MessageSourceServiceImpl()
| Method Detail |
|---|
public java.lang.String getMessage(java.lang.String s)
MessageSourceService
getMessage in interface MessageSourceServices - message code to retrieve
MessageSourceService.getMessage(java.lang.String)public MutableMessageSource getActiveMessageSource()
getActiveMessageSource in interface MessageSourceServicepublic void setActiveMessageSource(MutableMessageSource activeMessageSource)
setActiveMessageSource in interface MessageSourceServiceactiveMessageSource - the activeMessageSourceService to setpublic java.util.Collection<java.util.Locale> getLocales()
getLocales in interface MutableMessageSourceMutableMessageSource.getLocales()
public void publishProperties(java.util.Properties props,
java.lang.String locale,
java.lang.String namespace,
java.lang.String name,
java.lang.String version)
merge(MutableMessageSource, boolean) instead
publishProperties in interface MessageSourceServicepublishProperties in interface MutableMessageSourceprops - key/value properties for the messageslocale - locale in which the messages are expressednamespace - namespace within which the properties are valid ("" for generic, "module"
for modules, etc)name - unique name for the properties within the namespaceversion - version of the propertiesMessageSourceService.publishProperties(Properties, String,
String, String, String)public java.util.Collection<PresentationMessage> getPresentations()
getPresentations in interface MutableMessageSourceMutableMessageSource.getPresentations()
public java.lang.String getMessage(org.springframework.context.MessageSourceResolvable resolvable,
java.util.Locale locale)
getMessage in interface org.springframework.context.MessageSourceMessageSource.getMessage(org.springframework.context.MessageSourceResolvable,
java.util.Locale)
public java.lang.String getMessage(java.lang.String code,
java.lang.Object[] args,
java.util.Locale locale)
throws org.springframework.context.NoSuchMessageException
getMessage in interface org.springframework.context.MessageSourceorg.springframework.context.NoSuchMessageExceptionMessageSource.getMessage(java.lang.String,
java.lang.Object[], java.util.Locale)
public java.lang.String getMessage(java.lang.String code,
java.lang.Object[] args,
java.lang.String defaultMessage,
java.util.Locale locale)
getMessage in interface org.springframework.context.MessageSourceMessageSource.getMessage(java.lang.String,
java.lang.Object[], java.lang.String, java.util.Locale)public void addPresentation(PresentationMessage message)
MutableMessageSource
addPresentation in interface MutableMessageSourcemessage - message to add to the sourceMutableMessageSource.addPresentation(org.openmrs.messagesource.PresentationMessage)public void removePresentation(PresentationMessage message)
MutableMessageSource
removePresentation in interface MutableMessageSourcemessage - the message to removeMutableMessageSource.addPresentation(org.openmrs.messagesource.PresentationMessage)public java.util.Set<MutableMessageSource> getMessageSources()
getMessageSources in interface MessageSourceServicepublic void setMessageSources(java.util.Set<MutableMessageSource> availableMessageSources)
setMessageSources in interface MessageSourceServiceavailableMessageSources - the availableMessageSources to set
public void merge(MutableMessageSource fromSource,
boolean overwrite)
merge in interface MutableMessageSourcefromSource - message source from which messages should be mergeoverwrite - whether to overwrite existing messagesMutableMessageSource.merge(MutableMessageSource, boolean)
public PresentationMessage getPresentation(java.lang.String key,
java.util.Locale forLocale)
MutableMessageSource
getPresentation in interface MutableMessageSourcekey - textual key for the messageforLocale - locale for which to get the message
MutableMessageSource.getPresentation(java.lang.String,
java.util.Locale)public java.util.Collection<PresentationMessage> getPresentationsInLocale(java.util.Locale locale)
MutableMessageSource
getPresentationsInLocale in interface MutableMessageSourcelocale - locale for which to get the messages
MutableMessageSource.getPresentationsInLocale(java.util.Locale)public org.springframework.context.MessageSource getParentMessageSource()
getParentMessageSource in interface org.springframework.context.HierarchicalMessageSourceHierarchicalMessageSource.getParentMessageSource()public void setParentMessageSource(org.springframework.context.MessageSource parent)
setParentMessageSource in interface org.springframework.context.HierarchicalMessageSourceHierarchicalMessageSource.setParentMessageSource(org.springframework.context.MessageSource)
|
OpenMRS-1.7.x | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||