|
Oracle® Database Globalization Development Kit Java API Reference 10g Release 2 (10.2) Part No. B14224-02 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--oracle.i18n.util.OraResourceBundle
The OraResourceBundle class is the factory class that
constructs a java.util.ResourceBundle instance.
This class provides the special locale fallback behaviors on top of the Java behaviors. The rules follow:
zh_SG) is
not found, it will fallback to the resource bundle for Chinese in China
(zh_CN) for Simplified Chinese translations.
zh_HK) is
not found, it will fallback to the resource bundle for Chinese in Taiwan
(zh_TW) for Traditional Chinese translations.
zh_MO) is not
found, it will fallback to the resource bundle for Chinese in Taiwan
(zh_TW) for Traditional Chinese translations.
zh_ and
zh) is not found, it will fallback to the resource bundle for
Chinese in China (zh_CN) for Simplified Chinese translations.
Locale.getDefault() method, will not be considered in
the fallback operations.
For example, assume the default locale is ja_JP and
the resource bundle for it is available. When the resource bundle for
es_MX is requested and neither resource bundle for
es or es_MX is provided, the base resource bundle
object that does not have a local suffix is returned.
The usage of the OraResourceBundle class is similar to the
java.util.ResourceBundle class, but the
OraResourceBundle class does not instantiate itself.
Instead, the return value of the getBundle method is
an instance of the subclass of the java.util.ResourceBundle
class.
The following is an example showing how to get the instance of the bundle:
import java.util.ResourceBundle;
import oracle.i18n.util.OraResourceBundle;
...
ResourceBundle resb = OraResourceBundle.getBundle(
"oracle.demo.wob.Translations", request.getLocale());
...
String resb = resb.getString("hello");
...
| Method Summary | |
static ResourceBundle |
getBundle(String baseName)
Deprecated. As of Oracle Database 10g Release 2 (10.2), replaced by getBundle(String, Locale) |
static ResourceBundle |
getBundle(String baseName,
Locale locale)
Returns a ResourceBundle object specified by the base class
name. |
static ResourceBundle |
getBundle(String baseName,
Locale locale,
ClassLoader classLoader)
Returns a ResourceBundle object specified by the base class
name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static ResourceBundle getBundle(String baseName,
Locale locale,
ClassLoader classLoader)
ResourceBundle object specified by the base class
name. A locale should be specified to get the
translations. The class loader can be specified if necessary.
baseName - a base name of the ResourceBundle classlocale - a locale used to specify the translation languageclassLoader - a ClassLoader object used to load the
ResourceBundle class
ResourceBundle object
public static ResourceBundle getBundle(String baseName,
Locale locale)
ResourceBundle object specified by the base class
name. A locale should be specified to get the
translations.
baseName - a base name of the ResourceBundle classlocale - a locale used to specify the translation language
ResourceBundle objectpublic static ResourceBundle getBundle(String baseName)
getBundle(String, Locale)
ResourceBundle object derived from the given base
class name. By default, the translation is in English.
baseName - a base name of the ResourceBundle class
ResourceBundle object
|
Oracle® Database Globalization Development Kit Java API Reference 10g Release 2 (10.2) Part No. B14224-02 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||