public abstract class AbstractMessages extends java.lang.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(java.util.Locale locale) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.String key)
Returns true if the bundle contains the named key.
|
java.lang.String |
format(java.lang.String key,
java.lang.Object... args)
Convenience for accessing a formatter and formatting a localized message with arguments.
|
java.lang.String |
get(java.lang.String key)
Returns the localized message for the given key.
|
MessageFormatter |
getFormatter(java.lang.String key)
Returns a formatter for the message, which can be used to substitute arguments (as per
Formatter). |
protected abstract java.lang.String |
valueForKey(java.lang.String key)
Invoked to provide the value for a particular key.
|
protected AbstractMessages(java.util.Locale locale)
protected abstract java.lang.String valueForKey(java.lang.String key)
key - the key to obtain a value for (case insensitive)public boolean contains(java.lang.String key)
Messagespublic java.lang.String get(java.lang.String key)
Messagespublic MessageFormatter getFormatter(java.lang.String key)
MessagesFormatter).getFormatter in interface Messages${project.version} - Copyright © 2003-2015 The Apache Software Foundation.