1. /*
  2. * @(#)MissingResourceException.java 1.16 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
  9. * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
  10. *
  11. * The original version of this source code and documentation
  12. * is copyrighted and owned by Taligent, Inc., a wholly-owned
  13. * subsidiary of IBM. These materials are provided under terms
  14. * of a License Agreement between Taligent and Sun. This technology
  15. * is protected by multiple US and International patents.
  16. *
  17. * This notice and attribution to Taligent may not be removed.
  18. * Taligent is a registered trademark of Taligent, Inc.
  19. *
  20. */
  21. package java.util;
  22. /**
  23. * Signals that a resource is missing.
  24. * @see java.lang.Exception
  25. * @see ResourceBundle
  26. * @version 1.16, 12/19/03
  27. * @author Mark Davis
  28. * @since JDK1.1
  29. */
  30. public
  31. class MissingResourceException extends RuntimeException {
  32. /**
  33. * Constructs a MissingResourceException with the specified information.
  34. * A detail message is a String that describes this particular exception.
  35. * @param s the detail message
  36. * @param className the name of the resource class
  37. * @param key the key for the missing resource.
  38. */
  39. public MissingResourceException(String s, String className, String key) {
  40. super(s);
  41. this.className = className;
  42. this.key = key;
  43. }
  44. /**
  45. * Gets parameter passed by constructor.
  46. *
  47. * @return the name of the resource class
  48. */
  49. public String getClassName() {
  50. return className;
  51. }
  52. /**
  53. * Gets parameter passed by constructor.
  54. *
  55. * @return the key for the missing resource
  56. */
  57. public String getKey() {
  58. return key;
  59. }
  60. //============ privates ============
  61. /**
  62. * The class name of the resource bundle requested by the user.
  63. * @serial
  64. */
  65. private String className;
  66. /**
  67. * The name of the specific resource requested by the user.
  68. * @serial
  69. */
  70. private String key;
  71. }