1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.seasar.tuigwaa.system;
17
18 import org.seasar.framework.message.MessageFormatter;
19
20 /***
21 * @author someda
22 */
23 public class TgwException extends Exception {
24
25 private static final long serialVersionUID = -1058116385857827825L;
26
27 private String messageCode;
28
29 private Object[] args;
30
31 private String message;
32
33 private String simpleMessage;
34
35 public TgwException(String messageCode){
36 this(messageCode,null,null);
37 }
38
39 public TgwException(String messageCode, Object[] args){
40 this(messageCode,args,null);
41 }
42
43 public TgwException(String messageCode, Object[] args, Throwable cause){
44 super(cause);
45 this.messageCode = messageCode;
46 this.args = args;
47 simpleMessage = MessageFormatter.getSimpleMessage(messageCode, args);
48 message = "[" + messageCode + "]" + simpleMessage;
49 }
50
51 public final String getMessageCode() {
52 return messageCode;
53 }
54
55 public final Object[] getArgs() {
56 return args;
57 }
58
59 public final String getMessage() {
60 return message;
61 }
62
63 protected void setMessage(String message) {
64 this.message = message;
65 }
66
67 public final String getSimpleMessage() {
68 return simpleMessage;
69 }
70
71 }