View Javadoc

1   package net.sourceforge.rpgee.exceptions;
2   
3   @SuppressWarnings("serial")
4   /**
5    * KeyMessageBasedExceptions provide a point for holding a "key", which would be a key value into a 
6    * resource somewhere for providing, one assumes, a simple error message.  Plans are to expand it 
7    * to include variable arguments allowing values to be passed in.
8    */
9   public class KeyMessageBasedException extends Exception {
10      public final static String      DEFAULT_MESSAGE  = "default.message";
11      private String  key  = new String(DEFAULT_MESSAGE);
12      
13      public KeyMessageBasedException() {
14          super();
15      }
16  
17      public KeyMessageBasedException(String key) {
18          super();
19          this.key = key;
20      }
21  
22      public KeyMessageBasedException(String message, Throwable cause, String key) {
23          super(message, cause);
24          this.key = key;
25      }
26  
27      public KeyMessageBasedException(String message, String key) {
28          super(message);
29          this.key = key;
30      }
31  
32      public KeyMessageBasedException(Throwable cause, String key) {
33          super(cause);
34          this.key = key;
35      }
36      
37      public String getKey() {
38          return key;
39      }
40  }