01: /*
02: *
03: *
04: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26: package javax.microedition.global;
27:
28: // JAVADOC COMMENT ELIDED
29: public final class ResourceException extends RuntimeException {
30:
31: // JAVADOC COMMENT ELIDED
32: public final static int DATA_ERROR = 5;
33:
34: // JAVADOC COMMENT ELIDED
35: public final static int METAFILE_NOT_FOUND = 7;
36:
37: // JAVADOC COMMENT ELIDED
38: public final static int NO_RESOURCES_FOR_BASE_NAME = 3;
39:
40: // JAVADOC COMMENT ELIDED
41: public final static int NO_SYSTEM_DEFAULT_LOCALE = 4;
42:
43: // JAVADOC COMMENT ELIDED
44: public final static int RESOURCE_NOT_FOUND = 1;
45:
46: // JAVADOC COMMENT ELIDED
47: public final static int UNKNOWN_ERROR = 0;
48:
49: // JAVADOC COMMENT ELIDED
50: public final static int UNKNOWN_RESOURCE_TYPE = 6;
51:
52: // JAVADOC COMMENT ELIDED
53: public final static int WRONG_RESOURCE_TYPE = 2;
54:
55: /**
56: * Error code.
57: */
58: private int err;
59:
60: // JAVADOC COMMENT ELIDED
61: public ResourceException(int err, java.lang.String message) {
62: super (message);
63: if ((err < 0) || (err > 7)) {
64: throw new IllegalArgumentException();
65: }
66: this .err = err;
67: }
68:
69: // JAVADOC COMMENT ELIDED
70: public int getErrorCode() {
71: return err;
72: }
73: }
|