org.openmrs.messagesource
Interface MutableMessageSource

All Superinterfaces:
org.springframework.context.HierarchicalMessageSource, org.springframework.context.MessageSource
All Known Subinterfaces:
MessageSourceService
All Known Implementing Classes:
CachedMessageSource, MessageSourceServiceImpl, MutableResourceBundleMessageSource

@Transactional
public interface MutableMessageSource
extends org.springframework.context.MessageSource, org.springframework.context.HierarchicalMessageSource

Extended MessageSource interface, which provides more information about the available messages and can be changed.


Method Summary
 void addPresentation(PresentationMessage message)
          Adds a presentation message to the source.
 java.util.Collection<java.util.Locale> getLocales()
          Gets the locales for which messages are available from this source.
 PresentationMessage getPresentation(java.lang.String key, java.util.Locale forLocale)
          Gets the PresentationMessage for a particular locale.
 java.util.Collection<PresentationMessage> getPresentations()
          Gets all of the available messages, packaged as PresentationMessages.
 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)
          Merge messages from another source into this 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)
 void removePresentation(PresentationMessage message)
          Removes a presentation message from the source.
 
Methods inherited from interface org.springframework.context.HierarchicalMessageSource
getParentMessageSource, setParentMessageSource
 
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
 

Method Detail

getLocales

java.util.Collection<java.util.Locale> getLocales()
Gets the locales for which messages are available from this source.

Returns:
available message locales

publishProperties

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)

Makes a collection of properties available as messages.

Parameters:
props - key/value properties for the messages
locale - locale in which the messages are expressed
namespace - namespace within which the properties are valid ("" for generic, "module" for modules, etc)
name - unique name for the properties within the namespace
version - version of the properties

getPresentations

java.util.Collection<PresentationMessage> getPresentations()
Gets all of the available messages, packaged as PresentationMessages.

Returns:
collection of presentation messages

getPresentationsInLocale

java.util.Collection<PresentationMessage> getPresentationsInLocale(java.util.Locale locale)
Gets alll the available messages in a particular locale, packaged as PresentationMessages.

Parameters:
locale - locale for which to get the messages
Returns:
collection of PresentationMessages in the locale

addPresentation

void addPresentation(PresentationMessage message)
Adds a presentation message to the source. This operation should overwrite any existing message which conflicts (has the same code and locale).

Parameters:
message - message to add to the source

getPresentation

PresentationMessage getPresentation(java.lang.String key,
                                    java.util.Locale forLocale)
Gets the PresentationMessage for a particular locale.

Parameters:
key - textual key for the message
forLocale - locale for which to get the message
Returns:
corresponding PresentationMessage, or null if not available

removePresentation

void removePresentation(PresentationMessage message)
Removes a presentation message from the source.

Parameters:
message - the message to remove

merge

void merge(MutableMessageSource fromSource,
           boolean overwrite)
Merge messages from another source into this source.

Parameters:
fromSource - message source from which messages should be merge
overwrite - whether to overwrite existing messages

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change