ICU Enhancement
This class is ICU's replacement for java..
ICU
Methods, fields, and other functionality specific to ICU are labeled 'ICU'.
A class representing a collection of resource information pertaining to a given locale. A resource bundle provides a way of accessing locale- specific information in a data file. You create a resource bundle that manages the resources for a given locale and then ask it for individual resources.
In ResourceBundle, an object is created and the sub-items are fetched using the getString and 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 that 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.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/mycompany/resources",
"en_US", myClassLoader);
To open Java/JDK style organization use:
UResourceBundle bundle =
UResourceBundle.getBundleInstance("com.mycompany.resources.LocaleElements",
"en_US", myClassLoader);
Note
Please use pass a class loader for loading non-ICU resources. Java security does not allow loading of resources across jar files. You must provide your class loader to load the resources
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ARRAY
ICU |
| public static final int | BINARY
ICU |
| public static final int | INT
ICU |
| public static final int | INT_VECTOR
Resource type constant for vectors of 32-bit integers. |
| public static final int | NONE
ICU |
| private static Map | |
| public static final int | STRING
ICU |
| public static final int | TABLE
ICU |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected UResourceBundle | Returns: the resource, or nullthe key associated with the wanted resource aKey)
Deprecated
This API is ICU internal only.
Returns a resource in a given resource that has a given key, or null if the
resource is not found.
|
| protected UResourceBundle | Returns: the resource, or nullthe index of the resource index)
Deprecated
This API is ICU internal only.
Returns a resource in a given resource that has a given index, or null if the
resource is not found.
|
| public UResourceBundle | |
| public UResourceBundle | |
| protected abstract String | |
| public ByteBuffer | Returns: a pointer to a chunk of unsigned bytes which live in a memory mapped/DLL file.ICU |
| public byte[] | Returns: an array of bytes containing the binary data from the resource.The byte array to write the bytes to. A null variable is OK. ba)ICU |
| public static UResourceBundle | Returns: a resource bundle for the given base name and localestring containing the name of the data package.
If null the default ICU package name is used. baseName, String the locale for which a resource bundle is desired localeName)ICU |
| public static UResourceBundle | Returns: a resource bundle for the given base name and localestring containing the name of the data package.
If null the default ICU package name is used. baseName, String the locale for which a resource bundle is desired localeName, ClassLoader the class object from which to load the resource bundle root)ICU |
| protected static UResourceBundle | Returns: a resource bundle for the given base name and localestring containing the name of the data package.
If null the default ICU package name is used. baseName, String the locale for which a resource bundle is desired localeName, ClassLoader the class object from which to load the resource bundle root, boolean Option to disable locale inheritance.
If true the fallback chain will not be built. disableFallback)ICU |
| public static UResourceBundle | Returns: a resource bundle for the given localespecifies the locale for which we want to open the resource.
If null the bundle for default locale is opened. locale)ICU |
| public static UResourceBundle | Returns: a resource bundle for the given base name and default localestring containing the name of the data package.
If null the default ICU package name is used. baseName)ICU |
| public static UResourceBundle | Returns: a resource bundle for the given base name and localestring containing the name of the data package.
If null the default ICU package name is used. baseName, Locale specifies the locale for which we want to open the resource.
If null the bundle for default locale is opened. locale)ICU |
| public static UResourceBundle | Returns: a resource bundle for the given base name and localestring containing the name of the data package.
If null the default ICU package name is used. baseName, ULocale specifies the locale for which we want to open the resource.
If null the bundle for default locale is opened. locale)ICU |
| public static UResourceBundle | Returns: a resource bundle for the given base name and localestring containing the name of the data package.
If null the default ICU package name is used. baseName, Locale specifies the locale for which we want to open the resource.
If null the bundle for default locale is opened. locale, ClassLoader the loader to use loader)ICU |
| public static UResourceBundle | Returns: a resource bundle for the given base name and localestring containing the name of the data package.
If null the default ICU package name is used. baseName, ULocale specifies the locale for which we want to open the resource.
If null the bundle for default locale is opened. locale, ClassLoader the loader to use loader)ICU |
| public int | |
| public int[] | Returns: a pointer to a chunk of unsigned bytes which live in a memory mapped/DLL file.ICU |
| public UResourceBundleIterator | |
| public String | |
| public Enumeration | Returns: an enumeration containing key strings, which is empty if this is not a bundle or a table resourceImplements abstract java. |
| public Locale | Returns: the locale of this resource bundleOverrides java. |
| protected abstract String | |
| protected abstract UResourceBundle | |
| private static UResourceBundle. | |
| public int | |
| public String | |
| public String | Returns: a string which lives in the resource.an index to the wanted string. index)Returns the string in a given resource at the specified index. |
| public String[] | |
| public int | |
| public int | |
| public abstract ULocale | |
| public VersionInfo | |
| protected UResourceBundle | Returns: UResourceBundle a resource associated with the keythe key string of the resource to be fetched aKey, HashMap<String, String> hashtable object to hold references of resources already seen aliasesVisited, UResourceBundle the original resource bundle object on which the get method was invoked.
The requested bundle and the bundle on which this method is invoked
are the same, except in the cases where aliases are involved. requested)ICU |
| protected UResourceBundle | Returns: UResourceBundle a resource associated with the indexthe index of the resource to be fetched index, HashMap<String, String> hashtable object to hold references of resources already seen aliasesVisited, UResourceBundle the original resource bundle object on which the get method was invoked.
The requested bundle and the bundle on which this method is invoked
are the same, except in the cases where aliases are involved. requested)ICU |
| protected Enumeration | |
| protected Object | handleGetObject(String
the key for the desired object aKey)Implements abstract java. |
| private Object | |
| protected String[] | |
| protected Set | Returns: a Set of the keys contained only in this ResourceBundle, which is empty if this is not a bundle or a table resourceOverrides java.
Deprecated
This API is ICU internal only.
Returns a Set of the keys contained only in this ResourceBundle.
|
| protected static UResourceBundle | Returns: a resource bundle for the given base name and localestring containing the name of the data package.
If null the default ICU package name is used. baseName, String the locale for which a resource bundle is desired localeName, ClassLoader the class object from which to load the resource bundle root, boolean disables loading of fallback lookup chain disableFallback)ICU |
| protected boolean | Returns: true if this is a top-level resource
Deprecated
This API is ICU internal only.
Is this a top-level resource, that is, a whole bundle?
|
| public Set | Returns: a Set of all keys contained in this ResourceBundle and its parent bundles, which is empty if this is not a bundle or a table resourceOverrides java.
Deprecated
This API is ICU internal only.
Returns a Set of all keys contained in this ResourceBundle and its parent bundles.
|
| private Object | |
| private static void |
| ARRAY | back to summary |
|---|---|
| public static final int ARRAY ICU
| |
| BINARY | back to summary |
|---|---|
| public static final int BINARY ICU
| |
| INT | back to summary |
|---|---|
| public static final int INT ICU | |
| INT_VECTOR | back to summary |
|---|---|
| public static final int INT_VECTOR Resource type constant for vectors of 32-bit integers.
| |
| NONE | back to summary |
|---|---|
| public static final int NONE ICU
| |
| ROOT_CACHE | back to summary |
|---|---|
| private static Map<String, UResourceBundle. | |
| STRING | back to summary |
|---|---|
| public static final int STRING ICU
| |
| TABLE | back to summary |
|---|---|
| public static final int TABLE ICU
| |
| UResourceBundle | back to summary |
|---|---|
| public UResourceBundle() ICU
| |
| findTopLevel | back to summary |
|---|---|
| protected UResourceBundle findTopLevel(String aKey)
Deprecated This API is ICU internal only. Returns a resource in a given resource that has a given key, or null if the resource is not found.
| |
| findTopLevel | back to summary |
|---|---|
| protected UResourceBundle findTopLevel(int index)
Deprecated This API is ICU internal only. Returns a resource in a given resource that has a given index, or null if the resource is not found.
| |
| get | back to summary |
|---|---|
| public UResourceBundle get(String aKey) ICU
| |
| get | back to summary |
|---|---|
| public UResourceBundle get(int index) ICU
| |
| getBaseName | back to summary |
|---|---|
| protected abstract String getBaseName() ICU | |
| getBinary | back to summary |
|---|---|
| public ByteBuffer getBinary() ICU
| |
| getBinary | back to summary |
|---|---|
| public byte[] getBinary(byte[] ba) ICU
| |
| getBundleInstance | back to summary |
|---|---|
| public static UResourceBundle getBundleInstance(String baseName, String localeName) ICU
| |
| getBundleInstance | back to summary |
|---|---|
| public static UResourceBundle getBundleInstance(String baseName, String localeName, ClassLoader root) ICU
| |
| getBundleInstance | back to summary |
|---|---|
| protected static UResourceBundle getBundleInstance(String baseName, String localeName, ClassLoader root, boolean disableFallback) ICU
| |
| getBundleInstance | back to summary |
|---|---|
| public static UResourceBundle getBundleInstance(ULocale locale) ICU
| |
| getBundleInstance | back to summary |
|---|---|
| public static UResourceBundle getBundleInstance(String baseName) ICU
| |
| getBundleInstance | back to summary |
|---|---|
| public static UResourceBundle getBundleInstance(String baseName, Locale locale) ICU
| |
| getBundleInstance | back to summary |
|---|---|
| public static UResourceBundle getBundleInstance(String baseName, ULocale locale) ICU
| |
| getBundleInstance | back to summary |
|---|---|
| public static UResourceBundle getBundleInstance(String baseName, Locale locale, ClassLoader loader) ICU
| |
| getBundleInstance | back to summary |
|---|---|
| public static UResourceBundle getBundleInstance(String baseName, ULocale locale, ClassLoader loader) ICU Note Please use this API for loading non-ICU resources. Java security does not allow loading of resources across jar files. You must provide your class loader to load the resources
| |
| getInt | back to summary |
|---|---|
| public int getInt() ICU
| |
| getIntVector | back to summary |
|---|---|
| public int[] getIntVector() ICU
| |
| getIterator | back to summary |
|---|---|
| public UResourceBundleIterator getIterator() ICU
| |
| getKey | back to summary |
|---|---|
| public String getKey() ICU | |
| getKeys | back to summary |
|---|---|
| public Enumeration Implements abstract java. Returns the keys in this bundle as an enumeration
| |
| getLocale | back to summary |
|---|---|
| public Locale getLocale() Overrides java. Returns the locale of this bundle | |
| getLocaleID | back to summary |
|---|---|
| protected abstract String getLocaleID() ICU | |
| getParent | back to summary |
|---|---|
| protected abstract UResourceBundle getParent() ICU
| |
| getRootType | back to summary |
|---|---|
| private static UResourceBundle. | |
| getSize | back to summary |
|---|---|
| public int getSize() ICU Note Integer array is treated as a scalar type. There are no APIs to access individual members of an integer array. It is always returned as a whole.
| |
| getString | back to summary |
|---|---|
| public String getString() Returns a string from a string resource type
| |
| getString | back to summary |
|---|---|
| public String getString(int index) Returns the string in a given resource at the specified index.
| |
| getStringArray | back to summary |
|---|---|
| public String[] getStringArray() Returns a string array from a array resource type
| |
| getType | back to summary |
|---|---|
| public int getType() ICU INT, ARRAY,
BINARY, INT_VECTOR,
STRING, TABLE.
| |
| getUInt | back to summary |
|---|---|
| public int getUInt() ICU
| |
| getULocale | back to summary |
|---|---|
| public abstract ULocale getULocale() ICU | |
| getVersion | back to summary |
|---|---|
| public VersionInfo getVersion() ICU
| |
| handleGet | back to summary |
|---|---|
| protected UResourceBundle handleGet(String aKey, HashMap<String, String> aliasesVisited, UResourceBundle requested) ICU
| |
| handleGet | back to summary |
|---|---|
| protected UResourceBundle handleGet(int index, HashMap<String, String> aliasesVisited, UResourceBundle requested) ICU
| |
| handleGetKeys | back to summary |
|---|---|
| protected Enumeration ICU
| |
| handleGetObject | back to summary |
|---|---|
| protected Object handleGetObject(String aKey) Implements abstract java. Doc from java. Gets an object for the given key from this resource bundle. Returns null if this resource bundle does not contain an object for the given key. | |
| handleGetObjectImpl | back to summary |
|---|---|
| private Object handleGetObjectImpl(String aKey, UResourceBundle requested) Override the superclass method | |
| handleGetStringArray | back to summary |
|---|---|
| protected String[] handleGetStringArray() ICU | |
| handleKeySet | back to summary |
|---|---|
| protected Set Overrides java. Deprecated This API is ICU internal only. Returns a Set of the keys contained only in this ResourceBundle. This does not include further keys from parent bundles. | |
| instantiateBundle | back to summary |
|---|---|
| protected static UResourceBundle instantiateBundle(String baseName, String localeName, ClassLoader root, boolean disableFallback) ICU
| |
| isTopLevelResource | back to summary |
|---|---|
| protected boolean isTopLevelResource()
Deprecated This API is ICU internal only. Is this a top-level resource, that is, a whole bundle?
| |
| keySet | back to summary |
|---|---|
| public Set Overrides java. Deprecated This API is ICU internal only. Returns a Set of all keys contained in this ResourceBundle and its parent bundles. | |
| resolveObject | back to summary |
|---|---|
| private Object resolveObject(String aKey, UResourceBundle requested) | |
| setRootType | back to summary |
|---|---|
| private static void setRootType(String baseName, UResourceBundle. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final UResourceBundle. | |
| public static final UResourceBundle. | |
| public static final UResourceBundle. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static UResourceBundle. | |
| public static UResourceBundle. |
| ICU | back to summary |
|---|---|
| public static final UResourceBundle. | |
| JAVA | back to summary |
|---|---|
| public static final UResourceBundle. | |
| MISSING | back to summary |
|---|---|
| public static final UResourceBundle. | |
| RootType | back to summary |
|---|---|
| private RootType() | |
| valueOf | back to summary |
|---|---|
| public static UResourceBundle. | |
| values | back to summary |
|---|---|
| public static UResourceBundle. | |