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$ ($Author$)
Author:
Philipp Bracher

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

Method Detail

getLocale

Locale getLocale()
Returns:
current locale

getBasename

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

Returns:
current basename

get

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

Parameters:
key - the key
Returns:
message

get

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

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

getWithDefault

String getWithDefault(String key,
                      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

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

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

keys

Iterator<String> keys()
Iterate over the keys.

Returns:
iterator

reload

void reload()
            throws Exception
Reload the messages.

Throws:
Exception


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