Class AbstractMessages
java.lang.Object
org.apache.tapestry5.commons.util.AbstractMessages
- All Implemented Interfaces:
Messages
- Direct Known Subclasses:
MapMessages
,MessagesImpl
Abstract implementation of
Messages
that doesn't know where values come from (that information is supplied in
a subclass, via the valueForKey(String)
method).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the bundle contains the named key.Convenience for accessing a formatter and formatting a localized message with arguments.Returns the localized message for the given key.getFormatter
(String key) Returns a formatter for the message, which can be used to substitute arguments (as perFormatter
).protected abstract String
valueForKey
(String key) Invoked to provide the value for a particular key.
-
Constructor Details
-
AbstractMessages
-
-
Method Details
-
valueForKey
Invoked to provide the value for a particular key. This may be invoked multiple times even for the same key. The implementation should ignore the case of the key.- Parameters:
key
- the key to obtain a value for (case insensitive)- Returns:
- the value for the key, or null if this instance can not provide the value
-
contains
Description copied from interface:Messages
Returns true if the bundle contains the named key. -
get
Description copied from interface:Messages
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). -
getFormatter
Description copied from interface:Messages
Returns a formatter for the message, which can be used to substitute arguments (as perFormatter
).- Specified by:
getFormatter
in interfaceMessages
- Returns:
- formattable object
-
format
Description copied from interface:Messages
Convenience for accessing a formatter and formatting a localized message with arguments.
-