Package org.apache.tapestry5.commons
Interface Messages
-
- All Known Implementing Classes:
AbstractMessages
,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 with some changes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
key)
Returns true if the bundle contains the named key.key, ... args)
Convenience for accessing a formatter and formatting a localized message with arguments.key)
Returns the localized message for the given key.MessageFormatter
key)
Returns a formatter for the message, which can be used to substitute arguments (as per ).<>
getKeys()
Returns a set of all the keys for which this instance may provide a value.
-
-
-
Method Detail
-
contains
boolean key)
Returns true if the bundle contains the named key.
-
get
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
key)
Returns a formatter for the message, which can be used to substitute arguments (as per ).- Parameters:
key
-- Returns:
- formattable object
-
format
key, ... args)
Convenience for accessing a formatter and formatting a localized message with arguments.
-
getKeys
<> getKeys()
Returns a set of all the keys for which this instance may provide a value.- Returns:
- set of keys
- Since:
- 5.4
-
-