01: /*
02: * Copyright (C) The DNA Group. All rights reserved.
03: *
04: * This software is published under the terms of the DNA
05: * Software License version 1.1, a copy of which has been included
06: * with this distribution in the LICENSE.txt file.
07: */
08: package org.codehaus.dna;
09:
10: /**
11: * The MissingResourceException is used to signal a problem
12: * retrieving a resource from the ResourceLocator object.
13: *
14: * @version $Revision: 1.2 $ $Date: 2004/05/01 09:51:48 $
15: */
16: public class MissingResourceException extends Exception {
17: /**
18: * The exception that caused this exception if any.
19: */
20: private final Throwable m_cause;
21:
22: /**
23: * The resource key that caused the problem.
24: */
25: private final String m_key;
26:
27: /**
28: * Create a MissingResourceException with specified message
29: * and key.
30: *
31: * @param message the message
32: * @param key the key
33: */
34: public MissingResourceException(final String message,
35: final String key) {
36: this (message, key, null);
37: }
38:
39: /**
40: * Create a MissingResourceException with specified
41: * message, key and cause.
42: *
43: * @param message the message
44: * @param key the key
45: * @param cause the cause
46: */
47: public MissingResourceException(final String message,
48: final String key, final Throwable cause) {
49: super (message);
50: m_key = key;
51: m_cause = cause;
52: }
53:
54: /**
55: * Return the resource key that caused the problem.
56: *
57: * @return the resource key that caused the problem.
58: */
59: public String getKey() {
60: return m_key;
61: }
62:
63: /**
64: * Return the exception that caused this exception if any.
65: *
66: * @return the exception that caused this exception if any.
67: */
68: public Throwable getCause() {
69: return m_cause;
70: }
71: }
|