|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectse.datadosen.util.SmartResourceBundle
public class SmartResourceBundle
Similar to java.util.ResourceBundle, but handles property files containing UTF-8 encoded characters (auto-senses)
| Field Summary | |
|---|---|
protected SmartResourceBundle |
parent
The parent bundle of this bundle. |
protected java.util.Map |
resources
|
| Constructor Summary | |
|---|---|
protected |
SmartResourceBundle()
Sole constructor. |
| Method Summary | |
|---|---|
static SmartResourceBundle |
getBundle(java.lang.Class caller,
java.lang.String baseName)
Get resource bundle vs callers class |
static SmartResourceBundle |
getBundle(java.lang.Class callerClass,
java.lang.String baseName,
java.util.Locale locale)
Get resource bundle vs callers class |
static SmartResourceBundle |
getBundle(java.io.File dir,
java.lang.String baseName)
Get resource bundle vs given directory |
static SmartResourceBundle |
getBundle(java.io.File dir,
java.lang.String baseName,
java.util.Locale locale)
Get resource bundle vs given directory |
java.util.Set |
getKeys()
Returns an enumeration of the keys. |
java.util.Locale |
getLocale()
Returns the locale of this resource bundle. |
java.lang.Object |
getObject(java.lang.String key)
Gets an object for the given key from this resource bundle or one of its parents. |
java.lang.String |
getString(java.lang.String key)
Gets a string for the given key from this resource bundle or one of its parents. |
java.lang.String[] |
getStringArray(java.lang.String key)
Gets a string array for the given key from this resource bundle or one of its parents. |
boolean |
isTranslated(java.lang.String key)
|
static void |
main(java.lang.String[] args)
|
protected void |
setParent(SmartResourceBundle parent)
Sets the parent bundle of this bundle. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map resources
protected SmartResourceBundle parent
getObject when this bundle does not contain a particular resource.
| Constructor Detail |
|---|
protected SmartResourceBundle()
| Method Detail |
|---|
public final java.lang.String getString(java.lang.String key)
(String) getObject(key).
key - the key for the desired string
public final java.lang.String[] getStringArray(java.lang.String key)
(String[])
getObject(key).
key - the key for the desired string array
public final boolean isTranslated(java.lang.String key)
public final java.lang.Object getObject(java.lang.String key)
handleGetObject. If not successful, and the parent
resource bundle is not null, it calls the parent's getObject method. If still
not successful, it throws a MissingResourceException.
key - the key for the desired object
java.util.MissingResourceException - if no object for the given key can be foundpublic java.util.Locale getLocale()
protected void setParent(SmartResourceBundle parent)
getObject when this bundle does not contain a particular resource.
parent - this bundle's parent bundle.
public static SmartResourceBundle getBundle(java.io.File dir,
java.lang.String baseName)
public static SmartResourceBundle getBundle(java.io.File dir,
java.lang.String baseName,
java.util.Locale locale)
public static final SmartResourceBundle getBundle(java.lang.Class caller,
java.lang.String baseName)
public static final SmartResourceBundle getBundle(java.lang.Class callerClass,
java.lang.String baseName,
java.util.Locale locale)
public java.util.Set getKeys()
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||