001: /*
002: *
003: * @(#)MissingResourceException.java 1.19 06/10/10
004: *
005: * Portions Copyright 2000-2006 Sun Microsystems, Inc. All Rights
006: * Reserved. Use is subject to license terms.
007: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
008: *
009: * This program is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU General Public License version
011: * 2 only, as published by the Free Software Foundation.
012: *
013: * This program is distributed in the hope that it will be useful, but
014: * WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
016: * General Public License version 2 for more details (a copy is
017: * included at /legal/license.txt).
018: *
019: * You should have received a copy of the GNU General Public License
020: * version 2 along with this work; if not, write to the Free Software
021: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
022: * 02110-1301 USA
023: *
024: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
025: * Clara, CA 95054 or visit www.sun.com if you need additional
026: * information or have any questions.
027: */
028:
029: /*
030: * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
031: * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
032: *
033: * The original version of this source code and documentation
034: * is copyrighted and owned by Taligent, Inc., a wholly-owned
035: * subsidiary of IBM. These materials are provided under terms
036: * of a License Agreement between Taligent and Sun. This technology
037: * is protected by multiple US and International patents.
038: *
039: * This notice and attribution to Taligent may not be removed.
040: * Taligent is a registered trademark of Taligent, Inc.
041: *
042: */
043:
044: package java.util;
045:
046: /**
047: * Signals that a resource is missing.
048: * @see java.lang.Exception
049: * @see ResourceBundle
050: * @version 1.12, 01/19/00
051: * @author Mark Davis
052: * @since JDK1.1
053: */
054: public class MissingResourceException extends RuntimeException {
055:
056: /**
057: * Constructs a MissingResourceException with the specified information.
058: * A detail message is a String that describes this particular exception.
059: * @param s the detail message
060: * @param className the name of the resource class
061: * @param key the key for the missing resource.
062: */
063: public MissingResourceException(String s, String className,
064: String key) {
065: super (s);
066: this .className = className;
067: this .key = key;
068: }
069:
070: /**
071: * Gets parameter passed by constructor.
072: *
073: * @return the name of the resource class
074: */
075: public String getClassName() {
076: return className;
077: }
078:
079: /**
080: * Gets parameter passed by constructor.
081: *
082: * @return the key for the missing resource
083: */
084: public String getKey() {
085: return key;
086: }
087:
088: //============ privates ============
089:
090: /**
091: * The class name of the resource bundle requested by the user.
092: * @serial
093: */
094: private String className;
095:
096: /**
097: * The name of the specific resource requested by the user.
098: * @serial
099: */
100: private String key;
101: }
|