public abstract class AbstractBundle
extends java.lang.Object
'vcs'
bundles, 'aop'
bundles etc).
Usage pattern:
- Create class that extends this class and provides path to the target bundle to the current class constructor;
- Optionally create static facade method at the subclass - create single shared instance and delegate to its
getMessage(String, Object...)
;
Modifier | Constructor and Description |
---|---|
protected |
AbstractBundle(java.lang.String pathToBundle) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(java.lang.String key) |
protected java.util.ResourceBundle |
findBundle(java.lang.String pathToBundle,
java.lang.ClassLoader loader,
java.util.ResourceBundle.Control control) |
java.util.function.Supplier<java.lang.String> |
getLazyMessage(java.lang.String key,
java.lang.Object... params) |
java.lang.String |
getMessage(java.lang.String key,
java.lang.Object... params) |
java.util.ResourceBundle |
getResourceBundle() |
protected java.util.ResourceBundle |
getResourceBundle(java.lang.ClassLoader classLoader) |
java.util.ResourceBundle |
getResourceBundle(java.lang.String pathToBundle,
java.lang.ClassLoader loader) |
static java.lang.String |
message(java.util.ResourceBundle bundle,
java.lang.String key,
java.lang.Object... params) |
java.lang.String |
messageOfNull(java.lang.String key,
java.lang.Object... params) |
static java.lang.String |
messageOrDefault(java.util.ResourceBundle bundle,
java.lang.String key,
java.lang.String defaultValue,
java.lang.Object... params) |
java.lang.String |
messageOrDefault(java.lang.String key,
java.lang.String defaultValue,
java.lang.Object... params) |
static java.lang.String |
messageOrNull(java.util.ResourceBundle bundle,
java.lang.String key,
java.lang.Object... params) |
public java.lang.String getMessage(java.lang.String key, java.lang.Object... params)
public java.util.function.Supplier<java.lang.String> getLazyMessage(java.lang.String key, java.lang.Object... params)
public java.lang.String messageOfNull(java.lang.String key, java.lang.Object... params)
public java.lang.String messageOrDefault(java.lang.String key, java.lang.String defaultValue, java.lang.Object... params)
public static java.lang.String messageOrDefault(java.util.ResourceBundle bundle, java.lang.String key, java.lang.String defaultValue, java.lang.Object... params)
public static java.lang.String message(java.util.ResourceBundle bundle, java.lang.String key, java.lang.Object... params)
public static java.lang.String messageOrNull(java.util.ResourceBundle bundle, java.lang.String key, java.lang.Object... params)
public boolean containsKey(java.lang.String key)
public java.util.ResourceBundle getResourceBundle()
protected java.util.ResourceBundle getResourceBundle(java.lang.ClassLoader classLoader)
public java.util.ResourceBundle getResourceBundle(java.lang.String pathToBundle, java.lang.ClassLoader loader)
protected java.util.ResourceBundle findBundle(java.lang.String pathToBundle, java.lang.ClassLoader loader, java.util.ResourceBundle.Control control)