org.apache.tapestry5.ioc
Interface Messages

All Known Implementing Classes:
AbstractMessages, DelegatingMessagesImpl, MapMessages, MessagesImpl

public interface Messages

Provides access to a messages catalog, a set of properties files that provide localized messages for a particular locale. The message catalog consists of keys and values and follows the semantics of a Java ResourceBundle with some changes.


Method Summary
 boolean contains(String key)
          Returns true if the bundle contains the named key.
 String format(String key, Object... args)
          Convienience for accessing a formatter and formatting a localized message with arguments.
 String get(String key)
          Returns the localized message for the given key.
 MessageFormatter getFormatter(String key)
          Returns a formatter for the message, which can be used to substitute arguments (as per Formatter).
 

Method Detail

contains

boolean contains(String key)
Returns true if the bundle contains the named key.


get

String get(String key)
Returns the localized message for the given key. If catalog does not contain such a key, then a modified version of the key is returned (converted to upper case and enclosed in brackets).

Parameters:
key -
Returns:
localized message for key, or placeholder

getFormatter

MessageFormatter getFormatter(String key)
Returns a formatter for the message, which can be used to substitute arguments (as per Formatter).

Parameters:
key -
Returns:
formattable object

format

String format(String key,
              Object... args)
Convienience for accessing a formatter and formatting a localized message with arguments.



Copyright © 2003-2012 The Apache Software Foundation.