info.magnolia.cms.i18n
Interface Messages

All Known Implementing Classes:
AbstractMessagesImpl, DefaultMessagesImpl, EmptyMessages, MessagesChain

public interface Messages

Storage of messages - key value pairs.

Version:
$Revision: 41137 $ ($Author: gjoseph $)
Author:
Philipp Bracher

Method Summary
 java.lang.String get(java.lang.String key)
          Get the message from the bundle.
 java.lang.String get(java.lang.String key, java.lang.Object[] args)
          Replace the {n} parameters in the string.
 java.lang.String getBasename()
          If no basename is provided this method returns DEFAULT_BASENAME.
 java.util.Locale getLocale()
           
 java.lang.String getWithDefault(java.lang.String key, java.lang.Object[] args, java.lang.String defaultMsg)
          With default value and replacement strings.
 java.lang.String getWithDefault(java.lang.String key, java.lang.String defaultMsg)
          You can provide a default value if the key is not found.
 java.util.Iterator keys()
          Iterate over the keys.
 void reload()
          Reload the messages.
 

Method Detail

getLocale

java.util.Locale getLocale()
Returns:
current locale

getBasename

java.lang.String getBasename()
If no basename is provided this method returns DEFAULT_BASENAME.

Returns:
current basename

get

java.lang.String get(java.lang.String key)
Get the message from the bundle.

Parameters:
key - the key
Returns:
message

get

java.lang.String get(java.lang.String key,
                     java.lang.Object[] args)
Replace the {n} parameters in the string.

See Also:
MessageFormat.format(String, Object...)

getWithDefault

java.lang.String getWithDefault(java.lang.String key,
                                java.lang.String defaultMsg)
You can provide a default value if the key is not found.

Parameters:
key - key
defaultMsg - the default message
Returns:
the message

getWithDefault

java.lang.String getWithDefault(java.lang.String key,
                                java.lang.Object[] args,
                                java.lang.String defaultMsg)
With default value and replacement strings.

Parameters:
key - key
args - replacement strings
defaultMsg - default message
Returns:
message

keys

java.util.Iterator keys()
Iterate over the keys.

Returns:
iterator

reload

void reload()
            throws java.lang.Exception
Reload the messages.

Throws:
java.lang.Exception


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.