rt/emul/compact/src/main/java/java/util/MissingResourceException.java
author Jaroslav Tulach <jtulach@netbeans.org>
Thu, 03 Oct 2013 15:40:35 +0200
branchjdk7-b147
changeset 1334 588d5bf7a560
permissions -rw-r--r--
Set of JDK classes needed to run javac
jtulach@1334
     1
/*
jtulach@1334
     2
 * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
jtulach@1334
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jtulach@1334
     4
 *
jtulach@1334
     5
 * This code is free software; you can redistribute it and/or modify it
jtulach@1334
     6
 * under the terms of the GNU General Public License version 2 only, as
jtulach@1334
     7
 * published by the Free Software Foundation.  Oracle designates this
jtulach@1334
     8
 * particular file as subject to the "Classpath" exception as provided
jtulach@1334
     9
 * by Oracle in the LICENSE file that accompanied this code.
jtulach@1334
    10
 *
jtulach@1334
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
jtulach@1334
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jtulach@1334
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
jtulach@1334
    14
 * version 2 for more details (a copy is included in the LICENSE file that
jtulach@1334
    15
 * accompanied this code).
jtulach@1334
    16
 *
jtulach@1334
    17
 * You should have received a copy of the GNU General Public License version
jtulach@1334
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
jtulach@1334
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jtulach@1334
    20
 *
jtulach@1334
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jtulach@1334
    22
 * or visit www.oracle.com if you need additional information or have any
jtulach@1334
    23
 * questions.
jtulach@1334
    24
 */
jtulach@1334
    25
jtulach@1334
    26
/*
jtulach@1334
    27
 * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
jtulach@1334
    28
 * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
jtulach@1334
    29
 *
jtulach@1334
    30
 * The original version of this source code and documentation
jtulach@1334
    31
 * is copyrighted and owned by Taligent, Inc., a wholly-owned
jtulach@1334
    32
 * subsidiary of IBM. These materials are provided under terms
jtulach@1334
    33
 * of a License Agreement between Taligent and Sun. This technology
jtulach@1334
    34
 * is protected by multiple US and International patents.
jtulach@1334
    35
 *
jtulach@1334
    36
 * This notice and attribution to Taligent may not be removed.
jtulach@1334
    37
 * Taligent is a registered trademark of Taligent, Inc.
jtulach@1334
    38
 *
jtulach@1334
    39
 */
jtulach@1334
    40
jtulach@1334
    41
package java.util;
jtulach@1334
    42
jtulach@1334
    43
/**
jtulach@1334
    44
 * Signals that a resource is missing.
jtulach@1334
    45
 * @see java.lang.Exception
jtulach@1334
    46
 * @see ResourceBundle
jtulach@1334
    47
 * @author      Mark Davis
jtulach@1334
    48
 * @since       JDK1.1
jtulach@1334
    49
 */
jtulach@1334
    50
public
jtulach@1334
    51
class MissingResourceException extends RuntimeException {
jtulach@1334
    52
jtulach@1334
    53
    /**
jtulach@1334
    54
     * Constructs a MissingResourceException with the specified information.
jtulach@1334
    55
     * A detail message is a String that describes this particular exception.
jtulach@1334
    56
     * @param s the detail message
jtulach@1334
    57
     * @param className the name of the resource class
jtulach@1334
    58
     * @param key the key for the missing resource.
jtulach@1334
    59
     */
jtulach@1334
    60
    public MissingResourceException(String s, String className, String key) {
jtulach@1334
    61
        super(s);
jtulach@1334
    62
        this.className = className;
jtulach@1334
    63
        this.key = key;
jtulach@1334
    64
    }
jtulach@1334
    65
jtulach@1334
    66
    /**
jtulach@1334
    67
     * Constructs a <code>MissingResourceException</code> with
jtulach@1334
    68
     * <code>message</code>, <code>className</code>, <code>key</code>,
jtulach@1334
    69
     * and <code>cause</code>. This constructor is package private for
jtulach@1334
    70
     * use by <code>ResourceBundle.getBundle</code>.
jtulach@1334
    71
     *
jtulach@1334
    72
     * @param message
jtulach@1334
    73
     *        the detail message
jtulach@1334
    74
     * @param className
jtulach@1334
    75
     *        the name of the resource class
jtulach@1334
    76
     * @param key
jtulach@1334
    77
     *        the key for the missing resource.
jtulach@1334
    78
     * @param cause
jtulach@1334
    79
     *        the cause (which is saved for later retrieval by the
jtulach@1334
    80
     *        {@link Throwable.getCause()} method). (A null value is
jtulach@1334
    81
     *        permitted, and indicates that the cause is nonexistent
jtulach@1334
    82
     *        or unknown.)
jtulach@1334
    83
     */
jtulach@1334
    84
    MissingResourceException(String message, String className, String key, Throwable cause) {
jtulach@1334
    85
        super(message, cause);
jtulach@1334
    86
        this.className = className;
jtulach@1334
    87
        this.key = key;
jtulach@1334
    88
    }
jtulach@1334
    89
jtulach@1334
    90
    /**
jtulach@1334
    91
     * Gets parameter passed by constructor.
jtulach@1334
    92
     *
jtulach@1334
    93
     * @return the name of the resource class
jtulach@1334
    94
     */
jtulach@1334
    95
    public String getClassName() {
jtulach@1334
    96
        return className;
jtulach@1334
    97
    }
jtulach@1334
    98
jtulach@1334
    99
    /**
jtulach@1334
   100
     * Gets parameter passed by constructor.
jtulach@1334
   101
     *
jtulach@1334
   102
     * @return the key for the missing resource
jtulach@1334
   103
     */
jtulach@1334
   104
    public String getKey() {
jtulach@1334
   105
        return key;
jtulach@1334
   106
    }
jtulach@1334
   107
jtulach@1334
   108
    //============ privates ============
jtulach@1334
   109
jtulach@1334
   110
    // serialization compatibility with JDK1.1
jtulach@1334
   111
    private static final long serialVersionUID = -4876345176062000401L;
jtulach@1334
   112
jtulach@1334
   113
    /**
jtulach@1334
   114
     * The class name of the resource bundle requested by the user.
jtulach@1334
   115
     * @serial
jtulach@1334
   116
     */
jtulach@1334
   117
    private String className;
jtulach@1334
   118
jtulach@1334
   119
    /**
jtulach@1334
   120
     * The name of the specific resource requested by the user.
jtulach@1334
   121
     * @serial
jtulach@1334
   122
     */
jtulach@1334
   123
    private String key;
jtulach@1334
   124
}