View Javadoc

1   /*
2    * Criado em 26/10/2004
3    *
4    */
5   package ecar.exception;
6   
7   
8   /**
9    * @author N/C
10   * @since N/C
11   * @version N/C
12   */
13  public class ECARException extends Exception {
14  	private static final long serialVersionUID = 8965552994271665523L;
15  	protected Throwable causaRaiz = null;
16  	private String messageKey = null;
17  	private Object[] messageArgs = null;
18  
19  	/**
20  	 * Construtor.<br>
21  	 * 
22  	 * @author N/C
23       * @since N/C
24       * @version N/C
25  	 */
26  	public ECARException() {
27  		super();
28  	}
29  
30  	/**
31  	 * Atribui valor especificado para String MessageKey.<br>
32  	 * 
33  	 * @author N/C
34       * @since N/C
35       * @version N/C
36  	 * @param String messageKeyLoc
37  	 */
38  	public ECARException(String messageKeyLoc) {
39  		setMessageKey(messageKeyLoc);
40  	}
41  	
42  	/**
43  	 * Atribui valor especificado para Throwable CausaRaiz.<br>
44  	 * 
45  	 * @author N/C
46       * @since N/C
47       * @version N/C
48  	 * @param Throwable causa
49  	 */
50  	public ECARException(Throwable causa) {
51  		setCausaRaiz(causa);
52  	}
53  	
54  	/**
55  	 * Atribui valores especificados para String messageKey e Throwable causaRaiz.<br>
56  	 * 
57  	 * @author N/C
58       * @since N/C
59       * @version N/C
60  	 * @param String messageKeyLoc
61  	 * @param Throwable causa
62  	 */
63  	public ECARException(String messageKeyLoc, Throwable causa) {
64  		setMessageKey(messageKeyLoc);
65  		setCausaRaiz(causa);
66  	}
67  	
68  	/**
69  	 * Atribui valores especificados para String messageKey, Throwable causaRaiz e Object[] messageArgs.<br>
70  	 * 
71  	 * @author N/C
72       * @since N/C
73       * @version N/C
74  	 * @param String messageKeyLoc
75  	 * @param Throwable causa
76  	 * @param Object[] messageArgsLoc
77  	 */
78  	public ECARException(String messageKeyLoc, 
79  				Throwable causa, 
80  				Object[] messageArgsLoc) {
81  		setMessageKey(messageKeyLoc);
82  		setCausaRaiz(causa);
83  		setMessageArgs(messageArgsLoc);
84  	}
85  	
86  	/**
87  	 * Retorna Throwable causaRaiz.<br>
88  	 * 
89  	 * @author N/C
90       * @since N/C
91       * @version N/C
92  	 * @return Throwable - Returns the causaRaiz.
93  	 */
94  	public Throwable getCausaRaiz() {
95  		return causaRaiz;
96  	}
97  	
98  	/**
99  	 * Atribui valor especificado para Throwable causaRaiz.<br>
100 	 * 
101 	 * @author N/C
102      * @since N/C
103      * @version N/C
104 	 * @param Throwable causaRaiz - The causaRaiz to set.
105 	 */
106 	public void setCausaRaiz(Throwable causaRaiz) {
107 		this.causaRaiz = causaRaiz;
108 	}
109 	
110 	/**
111 	 * Retorna Object[] messageArgs.<br>
112 	 * 
113 	 * @author N/C
114      * @since N/C
115      * @version N/C
116 	 * @return Object[] - Returns the messageArgs.
117 	 */
118 	public Object[] getMessageArgs() {
119 		return messageArgs;
120 	}
121 	
122 	/**
123 	 * Atribui valor especificado para Object[] messageArgs.<br>
124 	 * 
125 	 * @author N/C
126      * @since N/C
127      * @version N/C
128 	 * @param Object[] messageArgs - The messageArgs to set.
129 	 */
130 	public void setMessageArgs(Object[] messageArgs) {
131 		this.messageArgs = messageArgs;
132 	}
133 	
134 	/**
135 	 * Retorna String messageKey.<br>
136 	 * 
137 	 * @author N/C
138      * @since N/C
139      * @version N/C
140 	 * @return String - Returns the messageKey.
141 	 */
142 	public String getMessageKey() {
143 		return messageKey;
144 	}
145 	
146 	/**
147 	 * Atribui valor especificado para String messageKey.<br>
148 	 * 
149 	 * @author N/C
150      * @since N/C
151      * @version N/C
152 	 * @param String messageKey - The messageKey to set.
153 	 */
154 	public void setMessageKey(String messageKey) {
155 		this.messageKey = messageKey;
156 	}
157 }