|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.teiid.core.BundleUtil
public class BundleUtil
Field Summary | |
---|---|
protected java.lang.String |
pluginId
|
protected static java.util.ResourceBundle |
productProps
The product properties used to override default localized text. |
Constructor Summary | |
---|---|
BundleUtil(java.lang.String pluginId,
java.lang.String bundleName,
java.util.ResourceBundle bundle)
Construct an instance of this class by specifying the plugin ID. |
Method Summary | |
---|---|
static BundleUtil |
getBundleUtil(java.lang.Class<?> clazz)
Return the BundleUtil for the class. |
java.lang.String |
getString(java.lang.String key)
Get the string identified by the given key and localized to the current locale. |
java.lang.String |
getString(java.lang.String key,
java.util.List parameters)
Get the string identified by the given key and localized to the current locale, and replace placeholders in the localized string with the string form of the parameters. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object... parameters)
Get the string identified by the given key and localized to the current locale, and replace placeholders in the localized string with the string form of the parameters. |
java.lang.String |
getStringOrKey(java.lang.String key)
|
boolean |
keyExists(java.lang.String key)
Determines if the given key exists in the resource file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.ResourceBundle productProps
protected final java.lang.String pluginId
Constructor Detail |
---|
public BundleUtil(java.lang.String pluginId, java.lang.String bundleName, java.util.ResourceBundle bundle)
pluginId
- the identifier of the plugin for which this utility is being instantiatedbundleName
- the name of the resource bundle; used for problem reporting purposes onlybundle
- the resource bundleMethod Detail |
---|
public static BundleUtil getBundleUtil(java.lang.Class<?> clazz)
BundleUtil
for the class. The bundle must be in the same package or a parent package of the class.
clazz
-
public java.lang.String getString(java.lang.String key)
key
- the key in the resource file
"Missing message: " + key + " in: " + this.bundleName
if the string could
not be found in the current locale, or
"No message available"
if the key
is null.public boolean keyExists(java.lang.String key)
key
- the key in the resource file
public java.lang.String getString(java.lang.String key, java.util.List parameters)
key
- the key in the resource fileparameters
- the list of parameters that should replace placeholders in the localized string (e.g., "{0}", "{1}", etc.)
"Missing message: " + key + " in: " + this.bundleName
if the string could
not be found in the current locale, or
"No message available"
if the key
is null.public java.lang.String getString(java.lang.String key, java.lang.Object... parameters)
key
- the key in the resource fileparameters
- the list of parameters that should replace placeholders in the localized string (e.g., "{0}", "{1}", etc.)
"Missing message: " + key + " in: " + this.bundleName
if the string could
not be found in the current locale, or
"No message available"
if the key
is null.public java.lang.String getStringOrKey(java.lang.String key)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |