Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
ResourceBundle
com.ibm.icu.util.UResourceBundle
public abstract class UResourceBundle
extends ResourceBundle
root.res
|
--------
| |
fr.res en.res
|
--------
| |
fr_CA.res fr_FR.res
JAVA/JDK:
LocaleElements.res
|
-------------------
| |
LocaleElements_fr.res LocaleElements_en.res
|
---------------------------
| |
LocaleElements_fr_CA.res LocaleElements_fr_FR.res
Depending 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");
Constructor Summary | |
|
Method Summary | |
protected static void |
|
protected abstract String |
|
static UResourceBundle |
|
static UResourceBundle |
|
static UResourceBundle |
|
static UResourceBundle |
|
static UResourceBundle |
|
protected static UResourceBundle |
|
static UResourceBundle |
|
static UResourceBundle |
|
static UResourceBundle |
|
Locale |
|
protected abstract String |
|
protected abstract UResourceBundle |
|
abstract ULocale |
|
protected static UResourceBundle |
|
protected static UResourceBundle |
|
protected abstract void |
|
public UResourceBundle()
Sole constructor. (For invocation by subclass constructors, typically implicit.) This is public for compatibility with Java, whose compiler will generate public default constructors for an abstract class.
protected static void addToCache(ClassLoader cl, String fullName, ULocale defaultLocale, UResourceBundle b)
protected abstract String getBaseName()
Gets the base name of the resource bundle
- Returns:
- The string representation of the base name
public 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.
- 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
public 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.
- 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
public 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.
- 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
public static UResourceBundle getBundleInstance(String baseName, String localeName)
Creates a resource bundle using the specified base name and locale. ICU_DATA_CLASS is used as the default root.
- Parameters:
baseName
- the base name of the resource bundle, a fully qualified class namelocaleName
- the locale for which a resource bundle is desired
- Returns:
- a resource bundle for the given base name and locale
public static UResourceBundle getBundleInstance(String baseName, String localeName, ClassLoader root)
Creates a resource bundle using the specified base name, locale, and class root.
- Parameters:
baseName
- the base name of the resource bundle, a fully qualified class namelocaleName
- the locale for which a resource bundle is desiredroot
- the class object from which to load the resource bundle
- Returns:
- a resource bundle for the given base name and locale
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.
- Parameters:
baseName
- the base name of the resource bundle, a fully qualified class namelocaleName
- the locale for which a resource bundle is desiredroot
- the class object from which to load the resource bundledisableFallback
- 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
public static UResourceBundle getBundleInstance(String baseName, ULocale locale)
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.
- Returns:
- a resource bundle for the given base name and locale
public static UResourceBundle getBundleInstance(String baseName, ULocale locale, ClassLoader loader)
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
public static UResourceBundle getBundleInstance(ULocale locale)
Creates a UResourceBundle for the locale specified, from which users can extract resources by using their corresponding keys.
- 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
public Locale getLocale()
Get the locale of this bundle
- Returns:
- the locale of this resource bundle
protected abstract String getLocaleID()
Gets the localeID
- Returns:
- The string representation of the localeID
protected abstract UResourceBundle getParent()
Gets the parent bundle
- Returns:
- The parent bundle
public abstract ULocale getULocale()
Returns the RFC 3066 conformant locale id of this resource bundle. This method can be used after a call to getBundleInstance() to determine whether the resource bundle returned really corresponds to the requested locale or is a fallback.
- Returns:
- the locale 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. Optionally will disable loading of fallback bundles.
- Parameters:
baseName
- the base name of the resource bundle, a fully qualified class namelocaleName
- the locale for which a resource bundle is desiredroot
- the class object from which to load the resource bundledisableFallback
- disables loading of fallback lookup chain
- Returns:
- a resource bundle for the given base name and locale
protected static UResourceBundle loadFromCache(ClassLoader cl, String fullName, ULocale defaultLocale)
protected abstract void setLoadingStatus(int newStatus)