|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.global.ResourceManager
public class ResourceManager
Field Summary | ||
---|---|---|
static String |
DEVICE
Constant to indicate device resources. |
Method Summary | ||
---|---|---|
String |
getBaseName()
Gets the base name of this resource manager. |
|
byte[] |
getData(int id)
Gets a resource with the specified resource ID as a byte array containing arbitrary binary data. |
|
String |
getLocale()
Gets the locale of this resource manager. |
|
static ResourceManager |
getManager(String baseName)
Gets a resource manager for the specified base name and the system's default locale. |
|
static ResourceManager |
getManager(String baseName,
String locale)
Gets a resource manager for the specified base name and locale. |
|
static ResourceManager |
getManager(String baseName,
String[] locales)
Gets a resource manager for the specified base name and the first matching locale in the supplied array. |
|
Object |
getResource(int id)
Gets a resource with the specified ID. |
|
String |
getString(int id)
Gets a string with the specified resource ID. |
|
static String[] |
getSupportedLocales(String baseName)
Gets the locales supported by this resource manager for the given base name. |
|
boolean |
isCaching()
Returns the caching status of this resource manager. |
|
boolean |
isValidResourceID(int id)
Determines if the given resource ID is valid in this implementation. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEVICE
Method Detail |
---|
public static final ResourceManager getManager(String baseName) throws ResourceException, UnsupportedLocaleException
baseName
- the base name, DEVICE to retrieve device-specific resources
NullPointerException
- if the base name is null
ResourceException
- if the system default locale is null, or the resource file is invalid
UnsupportedLocaleException
- if the system's default locale (when non-null) is not listed in the meta-information file of this base name (for application resources only), or when device resources are not supported for the system's default localepublic static final ResourceManager getManager(String baseName, String locale) throws ResourceException, UnsupportedLocaleException
baseName
- the base name, non-empty for application resources, DEVICE (the empty string) for device resourceslocale
- the locale to use either as is or as a starting point for hierarchical matching
NullPointerException
- if the base name is null or if the locale is null
IllegalArgumentException
- if the locale identifier is not valid according to the MIDP 2.0 specification
ResourceException
- if no resources for the combination of base name and locale are found, or the resource file is invalid
UnsupportedLocaleException
- if locale is not listed in the meta-information file of this base name (application resources only)public static final ResourceManager getManager(String baseName, String[] locales) throws ResourceException, UnsupportedLocaleException
baseName
- the base name, non-empty for application resources, or DEVICE (the empty string) for device resourceslocales
- the array of locale identifiers to try
NullPointerException
- if the locales array is null, or if any of the locales in the array is null, or the base name is null
IllegalArgumentException
- if any of the locale identifiers in the array is invalid according to the MIDP 2.0 specification, or if the array is empty
ResourceException
- if no resources for the base name and any of the locales in the array are found
UnsupportedLocaleException
- if none of the locales in the array are listed in the meta-information file of this base name (for application resources), or when device resources are not supported for any of the localespublic String getBaseName()
public String getLocale()
public boolean isValidResourceID(int id)
id
- the resource ID
IllegalArgumentException
- if the resource ID is not in the defined rangepublic byte[] getData(int id) throws ResourceException
id
- the resource ID
ResourceException
- if the resource does not exist, or if the resource is not the correct type
IllegalArgumentException
- if the resource ID is invalidpublic Object getResource(int id) throws ResourceException
id
- the resource ID
ResourceException
- if the resource is not found, or if an application resource has an unknown type
IllegalArgumentException
- if the resource ID is invalidpublic String getString(int id) throws ResourceException
id
- the resource ID
ResourceException
- if the resource is not found, or if an application resource has an unknown type
IllegalArgumentException
- if the resource ID is invalidpublic static String[] getSupportedLocales(String baseName)
baseName
- the base name, non-empty for application resources, DEVICE (the empty string) for device resources
NullPointerException
- if the base name is null
ResourceException
- if the meta-information file is not found or it is not of the specified formatpublic boolean isCaching()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal