Top Description Inners Fields Constructors Methods
com.ibm.icu.util

public abstract Class UResourceBundle

extends ResourceBundle
Class Inheritance
Known Direct Subclasses
com.ibm.icu.impl.ICUResourceBundle, com.ibm.icu.impl.ResourceBundleWrapper
Imports
java.nio.ByteBuffer, java.util.Collections, .Enumeration, .HashMap, .Locale, .Map, .MissingResourceException, .ResourceBundle, .Set, .TreeSet, java.util.concurrent.ConcurrentHashMap, com.ibm.icu.impl.ICUData, .ICUResourceBundle, .ICUResourceBundleReader, .ResourceBundleWrapper

ICU Enhancement

This class is ICU's replacement for java.util.ResourceBundle.

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

Author
ram
ICU Status
Stable since ICU 3.0.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField 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<String, UResourceBundle.RootType>
public static final int
STRING

ICU

public static final int
TABLE

ICU

Inherited from java.util.ResourceBundle:
parent

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected UResourceBundle

Returns:

the resource, or null
findTopLevel
(String
the 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 null
findTopLevel
(int
the 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

Returns:

a resource bundle object representing the resource
get
(String
a key associated with the wanted resource
aKey
)

ICU

public UResourceBundle

Returns:

the sub resource UResourceBundle object
get
(int
an index to the wanted resource.
index
)

ICU

protected abstract String

Returns:

The string representation of the base name
getBaseName
()

ICU

public ByteBuffer

Returns:

a pointer to a chunk of unsigned bytes which live in a memory mapped/DLL file.
getBinary
()

ICU

public byte[]

Returns:

an array of bytes containing the binary data from the resource.
getBinary
(byte[]
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 locale
getBundleInstance
(String
string 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 locale
getBundleInstance
(String
string 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 locale
getBundleInstance
(String
string 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 locale
getBundleInstance
(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 default locale
getBundleInstance
(String
string 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 locale
getBundleInstance
(String
string 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 locale
getBundleInstance
(String
string 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 locale
getBundleInstance
(String
string 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 locale
getBundleInstance
(String
string 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

Returns:

an integer value
getInt
()

ICU

public int[]

Returns:

a pointer to a chunk of unsigned bytes which live in a memory mapped/DLL file.
getIntVector
()

ICU

public UResourceBundleIterator

Returns:

UResourceBundleIterator that iterates over the resources in the bundle
getIterator
()

ICU

public String

Returns:

a key associated to this resource, or null if it doesn't have a key
getKey
()

ICU

public Enumeration<String>

Returns:

an enumeration containing key strings, which is empty if this is not a bundle or a table resource
getKeys
()

Implements abstract java.util.ResourceBundle.getKeys.

Returns the keys in this bundle as an enumeration
public Locale

Returns:

the locale of this resource bundle
getLocale
()

Overrides java.util.ResourceBundle.getLocale.

Returns the locale of this bundle
protected abstract String

Returns:

The string representation of the localeID
getLocaleID
()

ICU

protected abstract UResourceBundle

Returns:

The parent bundle
getParent
()

ICU

private static UResourceBundle.RootType
getRootType(String baseName, ClassLoader root)

public int

Returns:

number of resources in a given resource.
getSize
()

ICU

public String

Returns:

a string
getString
()

Returns a string from a string resource type

public String

Returns:

a string which lives in the resource.
getString
(int
an index to the wanted string.
index
)

Returns the string in a given resource at the specified index.

public String[]

Returns:

a string
getStringArray
()

Returns a string array from a array resource type

public int

Returns:

type of the given resource.
getType
()

ICU

public int

Returns:

an integer value
getUInt
()

ICU

public abstract ULocale

Returns:

the locale of this resource bundle
getULocale
()

ICU

public VersionInfo

Returns:

VersionInfo object containing the version of the bundle
getVersion
()

ICU

protected UResourceBundle

Returns:

UResourceBundle a resource associated with the key
handleGet
(String
the 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 index
handleGet
(int
the 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<String>

Returns:

Enumeration An enumeration of all the keys in this resource.
handleGetKeys
()

ICU

protected Object
handleGetObject(String
the key for the desired object
aKey
)

Implements abstract java.util.ResourceBundle.handleGetObject.

Gets an object for the given key from this resource bundle.
private Object
handleGetObjectImpl(String aKey, UResourceBundle requested)

Override the superclass method

protected String[]

Returns:

String[] An array of strings containing strings
handleGetStringArray
()

ICU

protected Set<String>

Returns:

a Set of the keys contained only in this ResourceBundle, which is empty if this is not a bundle or a table resource
handleKeySet
()

Overrides java.util.ResourceBundle.handleKeySet.

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 locale
instantiateBundle
(String
string 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
isTopLevelResource
()

Deprecated This API is ICU internal only.
Is this a top-level resource, that is, a whole bundle?
public Set<String>

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 resource
keySet
()

Overrides java.util.ResourceBundle.keySet.

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
Inherited from java.util.ResourceBundle:
clearCacheclearCachecontainsKeygetBaseBundleNamegetBundlegetBundlegetBundlegetBundlegetBundlegetBundlegetBundlegetBundlegetObjectgetStringgetStringArraysetParent

Field Detail

ARRAYback to summary
public static final int ARRAY

ICU

Resource type constant for arrays of resources.
ICU Status
Stable since ICU 3.8.
BINARYback to summary
public static final int BINARY

ICU

Resource type constant for binary data.
ICU Status
Stable since ICU 3.8.
INTback to summary
public static final int INT

ICU

Resource type constant for a single 28-bit integer, interpreted as signed or unsigned by the getInt() function.
ICU Status
Stable since ICU 3.8.
See Also
getInt
INT_VECTORback to summary
public static final int INT_VECTOR

Resource type constant for vectors of 32-bit integers.

ICU Status
Stable since ICU 3.8.
See Also
getIntVector
NONEback to summary
public static final int NONE

ICU

Resource type constant for "no resource".
ICU Status
Stable since ICU 3.8.
ROOT_CACHEback to summary
private static Map<String, UResourceBundle.RootType> ROOT_CACHE
STRINGback to summary
public static final int STRING

ICU

Resource type constant for strings.
ICU Status
Stable since ICU 3.8.
TABLEback to summary
public static final int TABLE

ICU

Resource type constant for tables of key-value pairs.
ICU Status
Stable since ICU 3.8.

Constructor Detail

UResourceBundleback to summary
public UResourceBundle()

ICU

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.
ICU Status
Stable since ICU 3.0.

Method Detail

findTopLevelback 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.

Parameters
aKey:String

the key associated with the wanted resource

Returns:UResourceBundle

the resource, or null

Annotations
@Deprecated
ICU Status
Internal ICU component.
See Also
get(String)
findTopLevelback 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.

Parameters
index:int

the index of the resource

Returns:UResourceBundle

the resource, or null

Annotations
@Deprecated
ICU Status
Internal ICU component.
See Also
get(int)
getback to summary
public UResourceBundle get(String aKey)

ICU

Returns a resource in a given resource that has a given key.
Parameters
aKey:String

a key associated with the wanted resource

Returns:UResourceBundle

a resource bundle object representing the resource

Exceptions
MissingResourceException:
If resource bundle is missing.
ICU Status
Stable since ICU 3.8.
getback to summary
public UResourceBundle get(int index)

ICU

Returns the resource in a given resource at the specified index.
Parameters
index:int

an index to the wanted resource.

Returns:UResourceBundle

the sub resource UResourceBundle object

Exceptions
IndexOutOfBoundsException:
If the index value is out of bounds of accepted values.
MissingResourceException:
If the resource bundle is missing.
ICU Status
Stable since ICU 3.8.
getBaseNameback to summary
protected abstract String getBaseName()

ICU

Returns the base name of the resource bundle
Returns:String

The string representation of the base name

ICU Status
Stable since ICU 3.0.
getBinaryback to summary
public ByteBuffer getBinary()

ICU

Returns a binary data item from a binary resource, as a read-only ByteBuffer.
Returns:ByteBuffer

a pointer to a chunk of unsigned bytes which live in a memory mapped/DLL file.

Exceptions
MissingResourceException:
If no resource bundle can be found.
UResourceTypeMismatchException:
If the resource has a type mismatch.
ICU Status
Stable since ICU 3.8.
See Also
getIntVector, getInt
getBinaryback to summary
public byte[] getBinary(byte[] ba)

ICU

Returns a binary data from a binary resource, as a byte array with a copy of the bytes from the resource bundle.
Parameters
ba:byte[]

The byte array to write the bytes to. A null variable is OK.

Returns:byte[]

an array of bytes containing the binary data from the resource.

Exceptions
MissingResourceException:
If resource bundle is missing.
UResourceTypeMismatchException:
If resource bundle has a type mismatch.
ICU Status
Stable since ICU 3.8.
See Also
getIntVector, getInt
getBundleInstanceback to summary
public static UResourceBundle getBundleInstance(String baseName, String localeName)

ICU

Creates a resource bundle using the specified base name and locale. ICU_DATA_CLASS is used as the default root.
Parameters
baseName:String

string containing the name of the data package. If null the default ICU package name is used.

localeName:String

the locale for which a resource bundle is desired

Returns:UResourceBundle

a resource bundle for the given base name and locale

Exceptions
MissingResourceException:
If no resource bundle for the specified base name can be found
ICU Status
Stable since ICU 3.0.
getBundleInstanceback to summary
public static UResourceBundle getBundleInstance(String baseName, String localeName, ClassLoader root)

ICU

Creates a resource bundle using the specified base name, locale, and class root.
Parameters
baseName:String

string containing the name of the data package. If null the default ICU package name is used.

localeName:String

the locale for which a resource bundle is desired

root:ClassLoader

the class object from which to load the resource bundle

Returns:UResourceBundle

a resource bundle for the given base name and locale

Exceptions
MissingResourceException:
If no resource bundle for the specified base name can be found
ICU Status
Stable since ICU 3.0.
getBundleInstanceback to summary
protected static UResourceBundle getBundleInstance(String baseName, String localeName, ClassLoader root, boolean disableFallback)

ICU

Creates a resource bundle using the specified base name, locale, and class root.
Parameters
baseName:String

string containing the name of the data package. If null the default ICU package name is used.

localeName:String

the locale for which a resource bundle is desired

root:ClassLoader

the class object from which to load the resource bundle

disableFallback:boolean

Option to disable locale inheritance. If true the fallback chain will not be built.

Returns:UResourceBundle

a resource bundle for the given base name and locale

Exceptions
MissingResourceException:
if no resource bundle for the specified base name can be found
ICU Status
Stable since ICU 3.0.
getBundleInstanceback to summary
public static UResourceBundle getBundleInstance(ULocale locale)

ICU

Creates a UResourceBundle for the locale specified, from which users can extract resources by using their corresponding keys.
Parameters
locale:ULocale

specifies the locale for which we want to open the resource. If null the bundle for default locale is opened.

Returns:UResourceBundle

a resource bundle for the given locale

ICU Status
Stable since ICU 3.0.
getBundleInstanceback to summary
public static UResourceBundle getBundleInstance(String baseName)

ICU

Creates a UResourceBundle for the default locale and specified base name, from which users can extract resources by using their corresponding keys.
Parameters
baseName:String

string containing the name of the data package. If null the default ICU package name is used.

Returns:UResourceBundle

a resource bundle for the given base name and default locale

ICU Status
Stable since ICU 3.0.
getBundleInstanceback to summary
public static UResourceBundle getBundleInstance(String baseName, Locale locale)

ICU

Creates a UResourceBundle for the specified locale and specified base name, from which users can extract resources by using their corresponding keys.
Parameters
baseName:String

string containing the name of the data package. If null the default ICU package name is used.

locale:Locale

specifies the locale for which we want to open the resource. If null the bundle for default locale is opened.

Returns:UResourceBundle

a resource bundle for the given base name and locale

ICU Status
Stable since ICU 3.0.
getBundleInstanceback to summary
public static UResourceBundle getBundleInstance(String baseName, ULocale locale)

ICU

Creates a UResourceBundle, from which users can extract resources by using their corresponding keys.
Parameters
baseName:String

string containing the name of the data package. If null the default ICU package name is used.

locale:ULocale

specifies the locale for which we want to open the resource. If null the bundle for default locale is opened.

Returns:UResourceBundle

a resource bundle for the given base name and locale

ICU Status
Stable since ICU 3.0.
getBundleInstanceback to summary
public static UResourceBundle getBundleInstance(String baseName, Locale locale, ClassLoader loader)

ICU

Creates a UResourceBundle for the specified locale and specified base name, from which users can extract resources by using their corresponding keys.
Parameters
baseName:String

string containing the name of the data package. If null the default ICU package name is used.

locale:Locale

specifies the locale for which we want to open the resource. If null the bundle for default locale is opened.

loader:ClassLoader

the loader to use

Returns:UResourceBundle

a resource bundle for the given base name and locale

ICU Status
Stable since ICU 3.8.
getBundleInstanceback to summary
public static UResourceBundle getBundleInstance(String baseName, ULocale locale, ClassLoader loader)

ICU

Creates a UResourceBundle, from which users can extract resources by using their corresponding keys.

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

Parameters
baseName:String

string containing the name of the data package. If null the default ICU package name is used.

locale:ULocale

specifies the locale for which we want to open the resource. If null the bundle for default locale is opened.

loader:ClassLoader

the loader to use

Returns:UResourceBundle

a resource bundle for the given base name and locale

ICU Status
Stable since ICU 3.8.
getIntback to summary
public int getInt()

ICU

Returns a signed integer from a resource.
Returns:int

an integer value

Exceptions
MissingResourceException:
If resource bundle is missing.
UResourceTypeMismatchException:
If resource bundle type mismatch.
ICU Status
Stable since ICU 3.8.
See Also
getIntVector, getBinary()
getIntVectorback to summary
public int[] getIntVector()

ICU

Returns a 32 bit integer array from a resource.
Returns:int[]

a pointer to a chunk of unsigned bytes which live in a memory mapped/DLL file.

Exceptions
MissingResourceException:
If resource bundle is missing.
UResourceTypeMismatchException:
If resource bundle has a type mismatch.
ICU Status
Stable since ICU 3.8.
See Also
getBinary(), getInt
getIteratorback to summary
public UResourceBundleIterator getIterator()

ICU

Returns the iterator which iterates over this resource bundle
Returns:UResourceBundleIterator

UResourceBundleIterator that iterates over the resources in the bundle

ICU Status
Stable since ICU 3.8.
getKeyback to summary
public String getKey()

ICU

Returns the key associated with a given resource. Not all the resources have a key - only those that are members of a table.
Returns:String

a key associated to this resource, or null if it doesn't have a key

ICU Status
Stable since ICU 3.8.
getKeysback to summary
public Enumeration<String> getKeys()

Implements abstract java.util.ResourceBundle.getKeys.

Returns the keys in this bundle as an enumeration

Returns:Enumeration<String>

an enumeration containing key strings, which is empty if this is not a bundle or a table resource

Annotations
@Override
ICU Status
Stable since ICU 3.8.
getLocaleback to summary
public Locale getLocale()

Overrides java.util.ResourceBundle.getLocale.

Returns the locale of this bundle

Returns:Locale

the locale of this resource bundle

Annotations
@Override
ICU Status
Stable since ICU 3.0.
getLocaleIDback to summary
protected abstract String getLocaleID()

ICU

Returns the localeID
Returns:String

The string representation of the localeID

ICU Status
Stable since ICU 3.0.
getParentback to summary
protected abstract UResourceBundle getParent()

ICU

Returns the parent bundle
Returns:UResourceBundle

The parent bundle

ICU Status
Stable since ICU 3.0.
getRootTypeback to summary
private static UResourceBundle.RootType getRootType(String baseName, ClassLoader root)
getSizeback to summary
public int getSize()

ICU

Returns the size of a resource. Size for scalar types is always 1, and for vector/table types is the number of child resources

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.

Returns:int

number of resources in a given resource.

ICU Status
Stable since ICU 3.8.
getStringback to summary
public String getString()

Returns a string from a string resource type

Returns:String

a string

Exceptions
MissingResourceException:
If resource bundle is missing.
UResourceTypeMismatchException:
If resource bundle has a type mismatch.
ICU Status
Stable since ICU 3.8.
See Also
getBinary(), getIntVector, getInt
getStringback to summary
public String getString(int index)

Returns the string in a given resource at the specified index.

Parameters
index:int

an index to the wanted string.

Returns:String

a string which lives in the resource.

Exceptions
IndexOutOfBoundsException:
If the index value is out of bounds of accepted values.
UResourceTypeMismatchException:
If resource bundle type mismatch.
ICU Status
Stable since ICU 3.8.
getStringArrayback to summary
public String[] getStringArray()

Returns a string array from a array resource type

Returns:String[]

a string

Exceptions
MissingResourceException:
If resource bundle is missing.
UResourceTypeMismatchException:
If resource bundle has a type mismatch.
ICU Status
Stable since ICU 3.8.
See Also
getString(), getIntVector
getTypeback to summary
public int getType()

ICU

Returns the type of a resource. Available types are INT, ARRAY, BINARY, INT_VECTOR, STRING, TABLE.
Returns:int

type of the given resource.

ICU Status
Stable since ICU 3.8.
getUIntback to summary
public int getUInt()

ICU

Returns a unsigned integer from a resource. This integer is originally 28 bit and the sign gets propagated.
Returns:int

an integer value

Exceptions
MissingResourceException:
If resource bundle is missing.
UResourceTypeMismatchException:
If resource bundle type mismatch.
ICU Status
Stable since ICU 3.8.
See Also
getIntVector, getBinary()
getULocaleback to summary
public abstract ULocale getULocale()

ICU

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:ULocale

the locale of this resource bundle

ICU Status
Stable since ICU 3.0.
getVersionback to summary
public VersionInfo getVersion()

ICU

Return the version number associated with this UResourceBundle as an VersionInfo object.
Returns:VersionInfo

VersionInfo object containing the version of the bundle

ICU Status
Stable since ICU 3.8.
handleGetback to summary
protected UResourceBundle handleGet(String aKey, HashMap<String, String> aliasesVisited, UResourceBundle requested)

ICU

Actual worker method for fetching a resource based on the given key. Sub classes must override this method if they support resources with keys.
Parameters
aKey:String

the key string of the resource to be fetched

aliasesVisited:HashMap<String, String>

hashtable object to hold references of resources already seen

requested: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.

Returns:UResourceBundle

UResourceBundle a resource associated with the key

ICU Status
Stable since ICU 3.8.
handleGetback to summary
protected UResourceBundle handleGet(int index, HashMap<String, String> aliasesVisited, UResourceBundle requested)

ICU

Actual worker method for fetching a resource based on the given index. Sub classes must override this method if they support arrays of resources.
Parameters
index:int

the index of the resource to be fetched

aliasesVisited:HashMap<String, String>

hashtable object to hold references of resources already seen

requested: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.

Returns:UResourceBundle

UResourceBundle a resource associated with the index

ICU Status
Stable since ICU 3.8.
handleGetKeysback to summary
protected Enumeration<String> handleGetKeys()

ICU

Actual worker method for fetching the keys of resources contained in the resource. Sub classes must override this method if they support keys and associated resources.
Returns:Enumeration<String>

Enumeration An enumeration of all the keys in this resource.

ICU Status
Stable since ICU 3.8.
handleGetObjectback to summary
protected Object handleGetObject(String aKey)

Implements abstract java.util.ResourceBundle.handleGetObject.

Doc from java.util.ResourceBundle.handleGetObject.

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.

Parameters
aKey:String

the key for the desired object

Returns:Object

the object for the given key, or null

Annotations
@Override
ICU Status
Stable since ICU 3.8.
handleGetObjectImplback to summary
private Object handleGetObjectImpl(String aKey, UResourceBundle requested)

Override the superclass method

handleGetStringArrayback to summary
protected String[] handleGetStringArray()

ICU

Actual worker method for fetching the array of strings in a resource. Sub classes must override this method if they support arrays of strings.
Returns:String[]

String[] An array of strings containing strings

ICU Status
Stable since ICU 3.8.
handleKeySetback to summary
protected Set<String> handleKeySet()

Overrides java.util.ResourceBundle.handleKeySet.

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.

Returns:Set<String>

a Set of the keys contained only in this ResourceBundle, which is empty if this is not a bundle or a table resource

Annotations
@Override
@Deprecated
ICU Status
Internal ICU component.
instantiateBundleback to summary
protected static UResourceBundle instantiateBundle(String baseName, String localeName, ClassLoader root, boolean disableFallback)

ICU

Loads a new resource bundle for the given base name, locale and class loader. Optionally will disable loading of fallback bundles.
Parameters
baseName:String

string containing the name of the data package. If null the default ICU package name is used.

localeName:String

the locale for which a resource bundle is desired

root:ClassLoader

the class object from which to load the resource bundle

disableFallback:boolean

disables loading of fallback lookup chain

Returns:UResourceBundle

a resource bundle for the given base name and locale

Exceptions
MissingResourceException:
If no resource bundle for the specified base name can be found
ICU Status
Stable since ICU 3.0.
isTopLevelResourceback to summary
protected boolean isTopLevelResource()

Deprecated

This API is ICU internal only.

Is this a top-level resource, that is, a whole bundle?

Returns:boolean

true if this is a top-level resource

Annotations
@Deprecated
ICU Status
Internal ICU component.
keySetback to summary
public Set<String> keySet()

Overrides java.util.ResourceBundle.keySet.

Deprecated

This API is ICU internal only.

Returns a Set of all keys contained in this ResourceBundle and its parent bundles.

Returns:Set<String>

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 resource

Annotations
@Override
@Deprecated
ICU Status
Internal ICU component.
resolveObjectback to summary
private Object resolveObject(String aKey, UResourceBundle requested)
setRootTypeback to summary
private static void setRootType(String baseName, UResourceBundle.RootType rootType)
com.ibm.icu.util back to summary

private final Enum UResourceBundle.RootType

extends Enum<UResourceBundle.RootType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final UResourceBundle.RootType
public static final UResourceBundle.RootType
public static final UResourceBundle.RootType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static UResourceBundle.RootType
public static UResourceBundle.RootType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ICUback to summary
public static final UResourceBundle.RootType ICU
JAVAback to summary
public static final UResourceBundle.RootType JAVA
MISSINGback to summary
public static final UResourceBundle.RootType MISSING

Constructor Detail

RootTypeback to summary
private RootType()

Method Detail

valueOfback to summary
public static UResourceBundle.RootType valueOf(String name)
valuesback to summary
public static UResourceBundle.RootType[] values()