org.loom.i18n
Class ReloadableMessagesRepositoryFactory

java.lang.Object
  extended by org.loom.i18n.ReloadableMessagesRepositoryFactory
All Implemented Interfaces:
MessagesRepositoryFactory

public class ReloadableMessagesRepositoryFactory
extends java.lang.Object
implements MessagesRepositoryFactory

MessagesRepository instance used while in development. This instance will check if any resource has been modified and reload the contents if needed.


Constructor Summary
ReloadableMessagesRepositoryFactory()
           
 
Method Summary
 void addBrowserMessage(java.lang.String messageKey)
          Add a JSON message key.
 java.util.Locale getDefaultLocale()
           
 MessagesRepositoryFactory getDelegate()
           
 MessagesRepository getRepository(java.util.Locale locale)
          Return the MessagesRepository instance corresponding to this Locale.
 void setBrowserMessages(java.util.Set<java.lang.String> browserMessages)
          Replace the current set of JSON keys.
 void setDelegate(MessagesRepositoryFactory delegate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReloadableMessagesRepositoryFactory

public ReloadableMessagesRepositoryFactory()
Method Detail

getRepository

public MessagesRepository getRepository(java.util.Locale locale)
Description copied from interface: MessagesRepositoryFactory
Return the MessagesRepository instance corresponding to this Locale.

Specified by:
getRepository in interface MessagesRepositoryFactory

addBrowserMessage

public void addBrowserMessage(java.lang.String messageKey)
Description copied from interface: MessagesRepositoryFactory
Add a JSON message key.

Specified by:
addBrowserMessage in interface MessagesRepositoryFactory
Parameters:
messageKey - the message key to be added

setBrowserMessages

public void setBrowserMessages(java.util.Set<java.lang.String> browserMessages)
Description copied from interface: MessagesRepositoryFactory
Replace the current set of JSON keys. This is the list of messages keys that will be sent to the browser as a JSON object.

Specified by:
setBrowserMessages in interface MessagesRepositoryFactory
Parameters:
browserMessages - the new set of JSON keys

getDefaultLocale

public java.util.Locale getDefaultLocale()
Specified by:
getDefaultLocale in interface MessagesRepositoryFactory
Returns:
the locale applied by default. Defaults to Locale.getDefaultLocale()

getDelegate

public MessagesRepositoryFactory getDelegate()

setDelegate

@Inject
public void setDelegate(@Delegate
                               MessagesRepositoryFactory delegate)