- java.lang.Object
-
- com.googlecode.lanterna.bundle.BundleLocator
-
- Direct Known Subclasses:
LocalizedUIBundle
public abstract class BundleLocator extends java.lang.Object
This class permits to deal easily with bundles.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
BundleLocator.UTF8Control
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
bundleName
private static java.lang.ClassLoader
loader
-
Constructor Summary
Constructors Modifier Constructor Description protected
BundleLocator(java.lang.String bundleName)
Hidden constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.ResourceBundle
getBundle(java.util.Locale locale)
Gets the right bundle.
A cache is handled as well as the concurrent accesses.protected java.lang.String
getBundleKeyValue(java.util.Locale locale, java.lang.String key, java.lang.Object... parameters)
Method that centralizes the way to get the value associated to a bundle key.
-
-
-
Method Detail
-
getBundleKeyValue
protected java.lang.String getBundleKeyValue(java.util.Locale locale, java.lang.String key, java.lang.Object... parameters)
Method that centralizes the way to get the value associated to a bundle key.- Parameters:
locale
- the locale.key
- the key searched for.parameters
- the parameters to apply to the value associated to the key.- Returns:
- the formatted value associated to the given key. Empty string if no value exists for the given key.
-
getBundle
private java.util.ResourceBundle getBundle(java.util.Locale locale)
Gets the right bundle.
A cache is handled as well as the concurrent accesses.- Parameters:
locale
- the locale.- Returns:
- the instance of the bundle.
-
-