@Immutable public final class FormattedResourceBundle extends Object
ResourceBundle in order to format strings with
MessageFormat.format(String, Object[]).| Modifier and Type | Method and Description |
|---|---|
static FormattedResourceBundle |
bundle(String baseName)
Returns a formatted resource bundle for the given base name.
|
static FormattedResourceBundle |
bundle(String baseName,
Locale locale)
Returns a formatted resource bundle for the given base name with the
given locale.
|
String |
format(String key,
Object... args)
Looks up a string resource identified by
key in this resource
bundle and formats it with the given args using
String.format(String, Object[]). |
String |
lookup(String key)
Looks up a string resource identified by
key in this resource
bundle. |
static FormattedResourceBundle |
wrap(ResourceBundle bundle)
Wraps the given resource bundle for formatting strings.
|
public static FormattedResourceBundle bundle(String baseName)
baseName - the base name of the resource bundle.public static FormattedResourceBundle bundle(String baseName, Locale locale)
baseName - the base name of the resource bundle.locale - the locale to use for the lookup.public String format(String key, Object... args)
key in this resource
bundle and formats it with the given args using
String.format(String, Object[]).public String lookup(String key)
key in this resource
bundle.public static FormattedResourceBundle wrap(ResourceBundle bundle)
bundle - the resource bundle to wrap.Copyright © 2005–2017 Schlichtherle IT Services. All rights reserved.