|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.bea.domingo.i18n.Resources
public final class Resources
A class to simplify extracting localized strings, icons and other common resources from a ResourceBundle.
Constructor Summary | |
---|---|
Resources(java.lang.String theBaseName)
Constructor that builds a manager in default locale. |
|
Resources(java.lang.String theBaseName,
java.lang.ClassLoader theClassLoader)
Constructor that builds a manager in default locale using specified ClassLoader. |
|
Resources(java.lang.String theBaseName,
java.util.Locale theLocale)
Constructor that builds a manager in specified locale. |
|
Resources(java.lang.String theBaseName,
java.util.Locale theLocale,
java.lang.ClassLoader theClassLoader)
Constructor that builds a manager in specified locale. |
Method Summary | |
---|---|
java.lang.String |
format(java.lang.String key,
java.lang.Object[] args)
Retrieve a string from resource bundle and format it with specified arguments. |
boolean |
getBoolean(java.lang.String key)
Retrieve a boolean from bundle. |
boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Retrieve a boolean from bundle. |
java.util.ResourceBundle |
getBundle()
Retrieve underlying ResourceBundle. |
byte |
getByte(java.lang.String key)
Retrieve a byte from bundle. |
byte |
getByte(java.lang.String key,
byte defaultValue)
Retrieve a byte from bundle. |
char |
getChar(java.lang.String key)
Retrieve a char from bundle. |
char |
getChar(java.lang.String key,
char defaultValue)
Retrieve a char from bundle. |
java.util.Date |
getDate(java.lang.String key)
Retrieve a date from bundle. |
java.util.Date |
getDate(java.lang.String key,
java.util.Date defaultValue)
Retrieve a date from bundle. |
java.util.Date |
getDateTime(java.lang.String key)
Retrieve a date + time from bundle. |
java.util.Date |
getDateTime(java.lang.String key,
java.util.Date defaultValue)
Retrieve a time from bundle. |
double |
getDouble(java.lang.String key)
Retrieve a double from bundle. |
double |
getDouble(java.lang.String key,
double defaultValue)
Retrieve a double from bundle. |
float |
getFloat(java.lang.String key)
Retrieve a float from bundle. |
float |
getFloat(java.lang.String key,
float defaultValue)
Retrieve a float from bundle. |
int |
getInteger(java.lang.String key)
Retrieve a integer from bundle. |
int |
getInteger(java.lang.String key,
int defaultValue)
Retrieve a integer from bundle. |
long |
getLong(java.lang.String key)
Retrieve a long from bundle. |
long |
getLong(java.lang.String key,
long defaultValue)
Retrieve a long from bundle. |
short |
getShort(java.lang.String key)
Retrieve a short from bundle. |
short |
getShort(java.lang.String key,
short defaultValue)
Retrieve a short from bundle. |
java.lang.String |
getString(java.lang.String key)
Retrieve a raw string from bundle. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object arg1)
Retrieve a string from resource bundle and format it with specified arguments. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object arg1,
java.lang.Object arg2)
Retrieve a string from resource bundle and format it with specified arguments. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
Retrieve a string from resource bundle and format it with specified arguments. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
Retrieve a string from resource bundle and format it with specified arguments. |
java.util.Date |
getTime(java.lang.String key)
Retrieve a time from bundle. |
java.util.Date |
getTime(java.lang.String key,
java.util.Date defaultValue)
Retrieve a time from bundle. |
Resources |
withFailOnError(boolean failOnError)
Whether an exception should be thrown in case of an unknown resource or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Resources(java.lang.String theBaseName)
theBaseName
- the base name of ResourceBundlepublic Resources(java.lang.String theBaseName, java.lang.ClassLoader theClassLoader)
theBaseName
- the base name of ResourceBundletheClassLoader
- the classLoader to load ResourceBundle frompublic Resources(java.lang.String theBaseName, java.util.Locale theLocale)
theBaseName
- the base name of ResourceBundletheLocale
- the Locale for resource bundlepublic Resources(java.lang.String theBaseName, java.util.Locale theLocale, java.lang.ClassLoader theClassLoader)
theBaseName
- the base name of ResourceBundletheLocale
- the Locale for resource bundletheClassLoader
- the classLoader to load ResourceBundle fromMethod Detail |
---|
public Resources withFailOnError(boolean failOnError)
failOnError
- true
if an exception should be thrown
in case of an unknown resource, else false
public boolean getBoolean(java.lang.String key, boolean defaultValue) throws java.util.MissingResourceException
key
- the key of resourcedefaultValue
- the default value if key is missing
java.util.MissingResourceException
- if a resource wasn't foundpublic boolean getBoolean(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic byte getByte(java.lang.String key, byte defaultValue) throws java.util.MissingResourceException
key
- the key of resourcedefaultValue
- the default value if key is missing
java.util.MissingResourceException
- if a resource wasn't foundpublic byte getByte(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic char getChar(java.lang.String key, char defaultValue) throws java.util.MissingResourceException
key
- the key of resourcedefaultValue
- the default value if key is missing
java.util.MissingResourceException
- if a resource wasn't foundpublic char getChar(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic short getShort(java.lang.String key, short defaultValue) throws java.util.MissingResourceException
key
- the key of resourcedefaultValue
- the default value if key is missing
java.util.MissingResourceException
- if a resource wasn't foundpublic short getShort(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic int getInteger(java.lang.String key, int defaultValue) throws java.util.MissingResourceException
key
- the key of resourcedefaultValue
- the default value if key is missing
java.util.MissingResourceException
- if a resource wasn't foundpublic int getInteger(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic long getLong(java.lang.String key, long defaultValue) throws java.util.MissingResourceException
key
- the key of resourcedefaultValue
- the default value if key is missing
java.util.MissingResourceException
- if a resource wasn't foundpublic long getLong(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic float getFloat(java.lang.String key, float defaultValue) throws java.util.MissingResourceException
key
- the key of resourcedefaultValue
- the default value if key is missing
java.util.MissingResourceException
- if a resource wasn't foundpublic float getFloat(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic double getDouble(java.lang.String key, double defaultValue) throws java.util.MissingResourceException
key
- the key of resourcedefaultValue
- the default value if key is missing
java.util.MissingResourceException
- if a resource wasn't foundpublic double getDouble(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic java.util.Date getDate(java.lang.String key, java.util.Date defaultValue) throws java.util.MissingResourceException
key
- the key of resourcedefaultValue
- the default value if key is missing
java.util.MissingResourceException
- if a resource wasn't foundpublic java.util.Date getDate(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic java.util.Date getTime(java.lang.String key, java.util.Date defaultValue) throws java.util.MissingResourceException
key
- the key of resourcedefaultValue
- the default value if key is missing
java.util.MissingResourceException
- if a resource wasn't foundpublic java.util.Date getTime(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic java.util.Date getDateTime(java.lang.String key, java.util.Date defaultValue) throws java.util.MissingResourceException
key
- the key of resourcedefaultValue
- the default value if key is missing
java.util.MissingResourceException
- if a resource wasn't foundpublic java.util.Date getDateTime(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic java.lang.String getString(java.lang.String key) throws java.util.MissingResourceException
key
- the key of resource
java.util.MissingResourceException
- if a resource wasn't foundpublic java.lang.String getString(java.lang.String key, java.lang.Object arg1)
key
- the key for resourcearg1
- an argument
public java.lang.String getString(java.lang.String key, java.lang.Object arg1, java.lang.Object arg2)
key
- the key for resourcearg1
- an argumentarg2
- an argument
public java.lang.String getString(java.lang.String key, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
key
- the key for resourcearg1
- an argumentarg2
- an argumentarg3
- an argument
public java.lang.String getString(java.lang.String key, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
key
- the key for resourcearg1
- an argumentarg2
- an argumentarg3
- an argumentarg4
- an argument
public java.lang.String format(java.lang.String key, java.lang.Object[] args) throws java.util.MissingResourceException
key
- the key for resourceargs
- an array of arguments
java.util.MissingResourceException
- if withFailOnError(boolean)
is true and the requested resource wasn't foundwithFailOnError(boolean)
public java.util.ResourceBundle getBundle() throws java.util.MissingResourceException
java.util.MissingResourceException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |