public abstract class AbstractResourceBundle extends ResourceBundle
ResourceBundle implementations using this NLS support. NlsBundle
instead of using this class. ResourceBundles by sub-classing this class and simply define some public static final fields that
will be automatically added to the bundle using reflection (only from constructor). | Prefix | Comment | Example |
|---|---|---|
| ERR_ | Text for an exception message. | ERR_VALUE_NOT_SET = "The value \"{value}\" is not set!" |
| MSG_ | Text for a complete information message. | MSG_MAIN_OPTION_VERSION_USAGE = "Print the program-version." |
| INF_ | Text for a single information term. | INF_MAIN_MODE_DEFAULT = "default" |
| INT_ | Reserved for internal constants not to be localized. | INT_MAIN_OPTION_NAME_VERSION = "--version" |
ResourceBundle.Control| Modifier and Type | Field and Description |
|---|---|
private Hashtable<String,Object> |
bundle
The key value pairs; maps keys (String) to values (Object).
|
private static String |
PREFIX_INTERNAL_FIELD
Fields that start with this prefix ("INT_" ), will be ignored as
bundle properties. |
private Map<Object,String> |
reverse
the inverse map of
bundle |
parent| Constructor and Description |
|---|
AbstractResourceBundle()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(String key) |
String |
getKey(Object object)
This method is the inverse of
ResourceBundle.getObject(String). |
Enumeration<String> |
getKeys() |
protected Object |
handleGetObject(String key) |
Set<String> |
keySet() |
clearCache, clearCache, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, handleKeySet, setParentprivate static final String PREFIX_INTERNAL_FIELD
bundle properties.private Hashtable<String,Object> bundle
public String getKey(Object object)
ResourceBundle.getObject(String).object - is the object (potentially) retrieved via ResourceBundle.getObject(String).object or null if it was NOT retrieved via ResourceBundle.getObject(String)
from this instance.public Enumeration<String> getKeys()
getKeys in class ResourceBundlepublic boolean containsKey(String key)
containsKey in class ResourceBundlepublic Set<String> keySet()
keySet in class ResourceBundleprotected Object handleGetObject(String key)
handleGetObject in class ResourceBundleCopyright © 2001–2016 mmm-Team. All rights reserved.