Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
MissingResourceException |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. | |
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 | * | |
5 | * This code is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU General Public License version 2 only, as | |
7 | * published by the Free Software Foundation. Sun designates this | |
8 | * particular file as subject to the "Classpath" exception as provided | |
9 | * by Sun in the LICENSE file that accompanied this code. | |
10 | * | |
11 | * This code is distributed in the hope that it will be useful, but WITHOUT | |
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | * version 2 for more details (a copy is included in the LICENSE file that | |
15 | * accompanied this code). | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License version | |
18 | * 2 along with this work; if not, write to the Free Software Foundation, | |
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
20 | * | |
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
22 | * CA 95054 USA or visit www.sun.com if you need additional information or | |
23 | * have any questions. | |
24 | */ | |
25 | ||
26 | /* | |
27 | * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved | |
28 | * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved | |
29 | * | |
30 | * The original version of this source code and documentation | |
31 | * is copyrighted and owned by Taligent, Inc., a wholly-owned | |
32 | * subsidiary of IBM. These materials are provided under terms | |
33 | * of a License Agreement between Taligent and Sun. This technology | |
34 | * is protected by multiple US and International patents. | |
35 | * | |
36 | * This notice and attribution to Taligent may not be removed. | |
37 | * Taligent is a registered trademark of Taligent, Inc. | |
38 | * | |
39 | */ | |
40 | ||
41 | /* | |
42 | * NOTE: | |
43 | * | |
44 | * This class was backported from the JDK6 runtime library, because some of | |
45 | * the functionality in this class aren't available on JDK5, which is at | |
46 | * the moment the target JRE environment for running JavaFX applications. | |
47 | * Once JDK5 is not a supported platform anymore, this class should be | |
48 | * removed. | |
49 | */ | |
50 | ||
51 | package com.sun.javafx.runtime.util.backport; | |
52 | ||
53 | import java.util.*; | |
54 | ||
55 | /** | |
56 | * Signals that a resource is missing. | |
57 | * @see java.lang.Exception | |
58 | * @see ResourceBundle | |
59 | * @version 1.25, 05/05/07 | |
60 | * @author Mark Davis | |
61 | * @since JDK1.1 | |
62 | */ | |
63 | public | |
64 | class MissingResourceException extends RuntimeException { | |
65 | ||
66 | /** | |
67 | * Constructs a MissingResourceException with the specified information. | |
68 | * A detail message is a String that describes this particular exception. | |
69 | * @param s the detail message | |
70 | * @param className the name of the resource class | |
71 | * @param key the key for the missing resource. | |
72 | */ | |
73 | public MissingResourceException(String s, String className, String key) { | |
74 | 0 | super(s); |
75 | 0 | this.className = className; |
76 | 0 | this.key = key; |
77 | 0 | } |
78 | ||
79 | /** | |
80 | * Constructs a <code>MissingResourceException</code> with | |
81 | * <code>message</code>, <code>className</code>, <code>key</code>, | |
82 | * and <code>cause</code>. This constructor is package private for | |
83 | * use by <code>ResourceBundle.getBundle</code>. | |
84 | * | |
85 | * @param message | |
86 | * the detail message | |
87 | * @param className | |
88 | * the name of the resource class | |
89 | * @param key | |
90 | * the key for the missing resource. | |
91 | * @param cause | |
92 | * the cause (which is saved for later retrieval by the | |
93 | * {@link Throwable.getCause()} method). (A null value is | |
94 | * permitted, and indicates that the cause is nonexistent | |
95 | * or unknown.) | |
96 | */ | |
97 | MissingResourceException(String message, String className, String key, Throwable cause) { | |
98 | 0 | super(message, cause); |
99 | 0 | this.className = className; |
100 | 0 | this.key = key; |
101 | 0 | } |
102 | ||
103 | /** | |
104 | * Gets parameter passed by constructor. | |
105 | * | |
106 | * @return the name of the resource class | |
107 | */ | |
108 | public String getClassName() { | |
109 | 0 | return className; |
110 | } | |
111 | ||
112 | /** | |
113 | * Gets parameter passed by constructor. | |
114 | * | |
115 | * @return the key for the missing resource | |
116 | */ | |
117 | public String getKey() { | |
118 | 0 | return key; |
119 | } | |
120 | ||
121 | //============ privates ============ | |
122 | ||
123 | // serialization compatibility with JDK1.1 | |
124 | private static final long serialVersionUID = -4876345176062000401L; | |
125 | ||
126 | /** | |
127 | * The class name of the resource bundle requested by the user. | |
128 | * @serial | |
129 | */ | |
130 | private String className; | |
131 | ||
132 | /** | |
133 | * The name of the specific resource requested by the user. | |
134 | * @serial | |
135 | */ | |
136 | private String key; | |
137 | } |