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)
Messages
public String get(String key)
Messages
public MessageFormatter getFormatter(String key)
Messages
Formatter
).getFormatter
in interface Messages
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.