com.ibm.icu.util
public abstract class UResourceBundle extends ResourceBundle
In ResourceBundle class, an object is created and the sub items are fetched using getString, getObject methods. In UResourceBundle,each individual element of a resource is a resource by itself.
Resource bundles in ICU are currently defined using text files which conform to the following BNF definition. More on resource bundle concepts and syntax can be found in the Users Guide.
The packaging of ICU *.res files can be of two types ICU4C:
root.res | -------- | | fr.res en.res | -------- | | fr_CA.res fr_FR.resJAVA/JDK:
LocaleElements.res | ------------------- | | LocaleElements_fr.res LocaleElements_en.res | --------------------------- | | LocaleElements_fr_CA.res LocaleElements_fr_FR.resDepending on the organization of your resources, the syntax to getBundleInstance will change. To open ICU style organization use:
UResourceBundle bundle = UResourceBundle.getBundleInstance("com/ibm/icu/impl/data/icudt30b", "en_US");To open Java/JDK style organization use:
UResourceBundle bundle = UResourceBundle.getBundleInstance("com.ibm.icu.impl.data.LocaleElements", "en_US");
UNKNOWN: ICU 3.0
Constructor Summary | |
---|---|
UResourceBundle()
Sole constructor. |
Method Summary | |
---|---|
protected static void | addToCache(ClassLoader cl, String fullName, ULocale defaultLocale, UResourceBundle b) |
protected abstract String | getBaseName()
Gets the base name of the resource bundle |
static UResourceBundle | getBundleInstance(String baseName, String localeName)
Creates a resource bundle using the specified base name and locale.
|
static UResourceBundle | getBundleInstance(String baseName, String localeName, ClassLoader root)
Creates a resource bundle using the specified base name, locale, and class root.
|
protected static UResourceBundle | getBundleInstance(String baseName, String localeName, ClassLoader root, boolean disableFallback)
Creates a resource bundle using the specified base name, locale, and class root.
|
static UResourceBundle | getBundleInstance(ULocale locale)
Creates a UResourceBundle for the locale specified, from which users can extract resources by using
their corresponding keys. |
static UResourceBundle | getBundleInstance(String baseName)
Creates a UResourceBundle for the default locale and specified base name,
from which users can extract resources by using their corresponding keys. |
static UResourceBundle | getBundleInstance(String baseName, Locale locale)
Creates a UResourceBundle for the specified locale and specified base name,
from which users can extract resources by using their corresponding keys. |
static UResourceBundle | getBundleInstance(String baseName, ULocale locale)
Creates a UResourceBundle, from which users can extract resources by using
their corresponding keys. |
static UResourceBundle | getBundleInstance(String baseName, Locale locale, ClassLoader loader)
Creates a UResourceBundle for the specified locale and specified base name,
from which users can extract resources by using their corresponding keys. |
static UResourceBundle | getBundleInstance(String baseName, ULocale locale, ClassLoader loader)
Creates a UResourceBundle, from which users can extract resources by using
their corresponding keys. |
Locale | getLocale()
Get the locale of this bundle |
protected abstract String | getLocaleID()
Gets the localeID |
protected abstract UResourceBundle | getParent()
Gets the parent bundle |
abstract ULocale | getULocale()
Returns the RFC 3066 conformant locale id of this resource bundle.
|
protected static UResourceBundle | instantiateBundle(String baseName, String localeName, ClassLoader root, boolean disableFallback)
Loads a new resource bundle for the give base name, locale and class loader.
|
protected static UResourceBundle | loadFromCache(ClassLoader cl, String fullName, ULocale defaultLocale) |
protected abstract void | setLoadingStatus(int newStatus) |
UNKNOWN: ICU 3.0
Deprecated: This API is ICU internal only.
UNKNOWN: revisit for ICU 3.6
Returns: The string representation of the base name
UNKNOWN: ICU 3.0
Parameters: baseName the base name of the resource bundle, a fully qualified class name localeName the locale for which a resource bundle is desired
Returns: a resource bundle for the given base name and locale
Throws: MissingResourceException if no resource bundle for the specified base name can be found
UNKNOWN: ICU 3.0
Parameters: baseName the base name of the resource bundle, a fully qualified class name localeName the locale for which a resource bundle is desired root the class object from which to load the resource bundle
Returns: a resource bundle for the given base name and locale
Throws: MissingResourceException if no resource bundle for the specified base name can be found
UNKNOWN: ICU 3.0
Parameters: baseName the base name of the resource bundle, a fully qualified class name localeName the locale for which a resource bundle is desired root the class object from which to load the resource bundle disableFallback Option to disable locale inheritence. If true the fallback chain will not be built.
Returns: a resource bundle for the given base name and locale
Throws: MissingResourceException if no resource bundle for the specified base name can be found
UNKNOWN: ICU 3.0
Parameters: locale specifies the locale for which we want to open the resource. If null the bundle for default locale is opened.
Returns: a resource bundle for the given locale
UNKNOWN: ICU 3.0
Parameters: baseName specifies the locale for which we want to open the resource. If null the bundle for default locale is opened.
Returns: a resource bundle for the given base name and default locale
UNKNOWN: ICU 3.0
Parameters: baseName specifies the locale for which we want to open the resource. If null the bundle for default locale is opened. locale specifies the locale for which we want to open the resource. If null the bundle for default locale is opened.
Returns: a resource bundle for the given base name and locale
UNKNOWN: ICU 3.0
Parameters: baseName string containing the name of the data package. If null the default ICU package name is used. locale specifies the locale for which we want to open the resource. If null the bundle for default locale is opened.
Returns: a resource bundle for the given base name and locale
UNKNOWN: ICU 3.0
Deprecated: This API is ICU internal only.
Creates a UResourceBundle for the specified locale and specified base name, from which users can extract resources by using their corresponding keys.Parameters: baseName specifies the locale for which we want to open the resource. If null the bundle for default locale is opened. locale specifies the locale for which we want to open the resource. If null the bundle for default locale is opened. loader the loader to use
Returns: a resource bundle for the given base name and locale
UNKNOWN: revisit for ICU 3.6
Deprecated: This API is ICU internal only.
Creates a UResourceBundle, from which users can extract resources by using their corresponding keys.Parameters: baseName string containing the name of the data package. If null the default ICU package name is used. locale specifies the locale for which we want to open the resource. If null the bundle for default locale is opened. loader the loader to use
Returns: a resource bundle for the given base name and locale
UNKNOWN: revisit for ICU 3.6
Returns: the locale of this resource bundle
UNKNOWN: ICU 3.0
Returns: The string representation of the localeID
UNKNOWN: ICU 3.0
Returns: The parent bundle
UNKNOWN: ICU 3.0
Returns: the locale of this resource bundle
UNKNOWN: ICU 3.0
Parameters: baseName the base name of the resource bundle, a fully qualified class name localeName the locale for which a resource bundle is desired root the class object from which to load the resource bundle disableFallback disables loading of fallback lookup chain
Returns: a resource bundle for the given base name and locale
Throws: MissingResourceException if no resource bundle for the specified base name can be found
UNKNOWN: ICU 3.0
Deprecated: This API is ICU internal only.
UNKNOWN: revisit for ICU 3.6
Deprecated: This API is ICU internal only.
UNKNOWN: