public abstract class AbstractMessages extends Object implements Messages
Messages that doesn't know where values come from (that information is supplied in
a subclass, via the valueForKey(String) method).| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMessages(Locale locale) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String key)
Returns true if the bundle contains the named key.
|
String |
format(String key,
Object... args)
Convenience 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). |
protected abstract String |
valueForKey(String key)
Invoked to provide the value for a particular key.
|
protected AbstractMessages(Locale locale)
protected abstract String valueForKey(String key)
key - the key to obtain a value for (case insensitive)public boolean contains(String key)
Messagespublic String get(String key)
Messagespublic MessageFormatter getFormatter(String key)
MessagesFormatter).getFormatter in interface Messages5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.