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 public class TgwRuntimeException extends RuntimeException {
21
22 private static final long serialVersionUID = 2286971699966326123L;
23
24 private String messageCode;
25
26 private Object[] args;
27
28 private String message;
29
30 private String simpleMessage;
31
32 public TgwRuntimeException(String messageCode) {
33 this(messageCode, null, null);
34 }
35
36 public TgwRuntimeException(Throwable t) {
37 this("ETGW4001", null, t);
38 t.printStackTrace();
39 }
40
41 public TgwRuntimeException(String messageCode, Object[] args) {
42 this(messageCode, args, null);
43 }
44
45 public TgwRuntimeException(String messageCode, Object[] args,
46 Throwable cause) {
47 super(cause);
48 this.messageCode = messageCode;
49 this.args = args;
50 simpleMessage = MessageFormatter.getSimpleMessage(messageCode, args);
51 message = "[" + messageCode + "]" + simpleMessage;
52 }
53
54 public final String getMessageCode() {
55 return messageCode;
56 }
57
58 public final Object[] getArgs() {
59 return args;
60 }
61
62 public final String getMessage() {
63 return message;
64 }
65
66 protected void setMessage(String message) {
67 this.message = message;
68 }
69
70 public final String getSimpleMessage() {
71 return simpleMessage;
72 }
73
74 }