info.magnolia.cms.i18n
Class DefaultMessagesManager

java.lang.Object
  extended by info.magnolia.cms.i18n.MessagesManager
      extended by info.magnolia.cms.i18n.DefaultMessagesManager

@Singleton
public class DefaultMessagesManager
extends MessagesManager

Default MessagesManager implementation.

Version:
$Id$
Author:
philipp

Nested Class Summary
static class DefaultMessagesManager.MessagesID
          Used as the key in the Map.
 
Field Summary
 
Fields inherited from class info.magnolia.cms.i18n.MessagesManager
DEFAULT_BASENAME, FALLBACK_LOCALE, FALLBACK_NODEDATA, I18N_CONFIG_PATH, LANGUAGES_NODE_NAME
 
Constructor Summary
DefaultMessagesManager()
           
 
Method Summary
 Collection getAvailableLocales()
           
 Locale getDefaultLocale()
           
 Messages getMessagesInternal(String basename, Locale locale)
           
 void init()
          Called through the initialization process.
protected  void initMap()
          The lazy Map creates messages objects with a fall back to the default locale.
protected  void load()
          Load i18n configuration.
protected  Messages newMessages(DefaultMessagesManager.MessagesID messagesID)
          Initializes a new Messages instances for the given MessagesID.
 void reload()
          Reload i18n configuration.
 void setDefaultLocale(String defaultLocale)
          Deprecated. since 4.0 - not used and should not be. Use setLocale() on the SystemContext instead. --note: do not remove the method, make it private. applicationLocale field is still needed. --and/or remove duplication with SystemContext.locale
 void setMessages(Map messages)
           
 
Methods inherited from class info.magnolia.cms.i18n.MessagesManager
get, get, getInstance, getMessages, getMessages, getMessages, getMessages, getWithDefault, getWithDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMessagesManager

public DefaultMessagesManager()
Method Detail

init

public void init()
Called through the initialization process. (startup of the container)

Specified by:
init in class MessagesManager

initMap

protected void initMap()
The lazy Map creates messages objects with a fall back to the default locale.


newMessages

protected Messages newMessages(DefaultMessagesManager.MessagesID messagesID)
Initializes a new Messages instances for the given MessagesID. By default, we chain to the same bundle with the default Locale. (so untranslated messages show up in the default language)


load

protected void load()
Load i18n configuration.


reload

public void reload()
Reload i18n configuration.

Specified by:
reload in class MessagesManager

getMessagesInternal

public Messages getMessagesInternal(String basename,
                                    Locale locale)
Specified by:
getMessagesInternal in class MessagesManager

getDefaultLocale

public Locale getDefaultLocale()
Specified by:
getDefaultLocale in class MessagesManager

setDefaultLocale

public void setDefaultLocale(String defaultLocale)
Deprecated. since 4.0 - not used and should not be. Use setLocale() on the SystemContext instead. --note: do not remove the method, make it private. applicationLocale field is still needed. --and/or remove duplication with SystemContext.locale

Parameters:
defaultLocale - The defaultLocale to set.

getAvailableLocales

public Collection getAvailableLocales()
Specified by:
getAvailableLocales in class MessagesManager

setMessages

public void setMessages(Map messages)


Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.