javax.microedition.global
Class ResourceException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byjavax.microedition.global.ResourceException

public final class ResourceException
extends java.lang.RuntimeException

Thrown when a resource manager operation fails. Typical examples of operations that may fail are:

Error codes and detail messages

This class defines symbolic constants for error codes related to ResourceExceptions. The detail message corresponding to the error can be retrieved using the getMessage method. The detail messages SHOULD be localized.


Field Summary
static int DATA_ERROR
          A data error occurred when reading the resource file.
static int METAFILE_NOT_FOUND
          Meta-information file containing information about supported locales not found for base name.
static int NO_RESOURCES_FOR_BASE_NAME
          No resources for this base name found.
static int NO_SYSTEM_DEFAULT_LOCALE
          The system's default locale is not defined (is null).
static int RESOURCE_NOT_FOUND
          A resource with the specified ID was not found.
static int UNKNOWN_ERROR
          Unknown error.
static int UNKNOWN_RESOURCE_TYPE
          Encountered an unknown resource type in the resource file.
static int WRONG_RESOURCE_TYPE
          Wrong resource type.
 
Constructor Summary
ResourceException(int err, java.lang.String message)
          Constructs an exception instance with an error code and a detail message.
 
Method Summary
 int getErrorCode()
          Returns the error code associated with this exception.
 
Methods inherited from class java.lang.Throwable
getMessage, printStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATA_ERROR

public static final int DATA_ERROR

A data error occurred when reading the resource file.

See Also:
Constant Field Values

METAFILE_NOT_FOUND

public static final int METAFILE_NOT_FOUND

Meta-information file containing information about supported locales not found for base name.

See Also:
Constant Field Values

NO_RESOURCES_FOR_BASE_NAME

public static final int NO_RESOURCES_FOR_BASE_NAME

No resources for this base name found.

See Also:
Constant Field Values

NO_SYSTEM_DEFAULT_LOCALE

public static final int NO_SYSTEM_DEFAULT_LOCALE

The system's default locale is not defined (is null).

See Also:
Constant Field Values

RESOURCE_NOT_FOUND

public static final int RESOURCE_NOT_FOUND

A resource with the specified ID was not found.

See Also:
Constant Field Values

UNKNOWN_ERROR

public static final int UNKNOWN_ERROR

Unknown error.

See Also:
Constant Field Values

UNKNOWN_RESOURCE_TYPE

public static final int UNKNOWN_RESOURCE_TYPE

Encountered an unknown resource type in the resource file.

See Also:
Constant Field Values

WRONG_RESOURCE_TYPE

public static final int WRONG_RESOURCE_TYPE

Wrong resource type. Used when the method used does not match the resource retrieved with it (e.g. getString used to retrieve a byte array resource).

See Also:
Constant Field Values
Constructor Detail

ResourceException

public ResourceException(int err,
                         java.lang.String message)

Constructs an exception instance with an error code and a detail message.

Parameters:
err - the error code
message - the detail message
Throws:
java.lang.IllegalArgumentException - if the error code is undefined
Method Detail

getErrorCode

public int getErrorCode()

Returns the error code associated with this exception.

Returns:
the error code


Copyright © 2004-2005 Nokia Corporation. All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.