11 |
13 Sep 07 |
nicklas |
1 |
|
11 |
13 Sep 07 |
nicklas |
2 |
///////////////////////////////////////////////////////////////// |
11 |
13 Sep 07 |
nicklas |
3 |
// |
11 |
13 Sep 07 |
nicklas |
// Copyright (C) 2005 Affymetrix, Inc. |
11 |
13 Sep 07 |
nicklas |
5 |
// |
11 |
13 Sep 07 |
nicklas |
// This library is free software; you can redistribute it and/or modify |
11 |
13 Sep 07 |
nicklas |
// it under the terms of the GNU Lesser General Public License as published |
11 |
13 Sep 07 |
nicklas |
// by the Free Software Foundation; either version 2.1 of the License, |
11 |
13 Sep 07 |
nicklas |
// or (at your option) any later version. |
11 |
13 Sep 07 |
nicklas |
10 |
// |
11 |
13 Sep 07 |
nicklas |
// This library is distributed in the hope that it will be useful, but |
11 |
13 Sep 07 |
nicklas |
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
11 |
13 Sep 07 |
nicklas |
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License |
11 |
13 Sep 07 |
nicklas |
// for more details. |
11 |
13 Sep 07 |
nicklas |
15 |
// |
11 |
13 Sep 07 |
nicklas |
// You should have received a copy of the GNU Lesser General Public License |
11 |
13 Sep 07 |
nicklas |
// along with this library; if not, write to the Free Software Foundation, Inc., |
11 |
13 Sep 07 |
nicklas |
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
11 |
13 Sep 07 |
nicklas |
19 |
// |
11 |
13 Sep 07 |
nicklas |
20 |
///////////////////////////////////////////////////////////////// |
11 |
13 Sep 07 |
nicklas |
21 |
|
11 |
13 Sep 07 |
nicklas |
22 |
package affymetrix.calvin.exception; |
11 |
13 Sep 07 |
nicklas |
23 |
|
11 |
13 Sep 07 |
nicklas |
/** Base exception class for the Calvin File SDK. */ |
11 |
13 Sep 07 |
nicklas |
25 |
public class CalvinException extends Exception { |
11 |
13 Sep 07 |
nicklas |
26 |
|
11 |
13 Sep 07 |
nicklas |
/** Source in the WIN32 use case is used for registry lookup to determine the resource file. |
11 |
13 Sep 07 |
nicklas |
The message code is used incojuction with source to lookup the specific message string based on code. |
11 |
13 Sep 07 |
nicklas |
29 |
*/ |
11 |
13 Sep 07 |
nicklas |
30 |
protected String sourceName; |
11 |
13 Sep 07 |
nicklas |
/** Message for the exception */ |
11 |
13 Sep 07 |
nicklas |
32 |
protected String errorDescription; |
11 |
13 Sep 07 |
nicklas |
/** Date/Time stamp of exception */ |
11 |
13 Sep 07 |
nicklas |
34 |
protected String timeStamp; |
11 |
13 Sep 07 |
nicklas |
/** File the exception occured in */ |
11 |
13 Sep 07 |
nicklas |
36 |
protected String fileName; |
11 |
13 Sep 07 |
nicklas |
/** Line number that the exception occured */ |
11 |
13 Sep 07 |
nicklas |
38 |
protected short lineNumber; |
11 |
13 Sep 07 |
nicklas |
/** Message code to be used by client for logic or to use for lookup in localized resource file */ |
11 |
13 Sep 07 |
nicklas |
40 |
protected long errorCode; |
11 |
13 Sep 07 |
nicklas |
41 |
|
11 |
13 Sep 07 |
nicklas |
42 |
|
11 |
13 Sep 07 |
nicklas |
/** Constructor |
11 |
13 Sep 07 |
nicklas |
* Default constructor. Initializes all variables to 0 if numeric, "" if string and the date to the current date and time. |
11 |
13 Sep 07 |
nicklas |
45 |
*/ |
11 |
13 Sep 07 |
nicklas |
46 |
public CalvinException() { |
11 |
13 Sep 07 |
nicklas |
47 |
errorCode = 0; |
11 |
13 Sep 07 |
nicklas |
48 |
lineNumber = 0; |
11 |
13 Sep 07 |
nicklas |
49 |
fileName = ""; |
11 |
13 Sep 07 |
nicklas |
50 |
timeStamp = java.util.Calendar.getInstance().toString(); |
11 |
13 Sep 07 |
nicklas |
51 |
errorDescription = ""; |
11 |
13 Sep 07 |
nicklas |
52 |
sourceName = ""; |
11 |
13 Sep 07 |
nicklas |
53 |
} |
11 |
13 Sep 07 |
nicklas |
54 |
|
11 |
13 Sep 07 |
nicklas |
/** Constructor |
11 |
13 Sep 07 |
nicklas |
* Constructs a CalvinException object. |
11 |
13 Sep 07 |
nicklas |
57 |
* |
11 |
13 Sep 07 |
nicklas |
* @param _Source Typically will be the application name. Can also be the file sdk object type E.g. "Array File Reader". |
11 |
13 Sep 07 |
nicklas |
* @param _Description A brief message which describes what happened. |
11 |
13 Sep 07 |
nicklas |
* @param _TimeStamp Time and date the exception occured. |
11 |
13 Sep 07 |
nicklas |
* @param _FileName File name of the source file the exception occured. The __FILE__ can be used to determine this information. |
11 |
13 Sep 07 |
nicklas |
* @param _LineNumber Line number in the source file that generated the exception. The __LINE__ can be used to determine this information. |
11 |
13 Sep 07 |
nicklas |
* @param _ErrorCode An numeric value the is unique to this error/exception type |
11 |
13 Sep 07 |
nicklas |
64 |
*/ |
11 |
13 Sep 07 |
nicklas |
65 |
public CalvinException(String _Source, String _Description, String _TimeStamp, String _FileName, short _LineNumber, long _ErrorCode) { |
11 |
13 Sep 07 |
nicklas |
66 |
sourceName = _Source; |
11 |
13 Sep 07 |
nicklas |
67 |
errorDescription=_Description; |
11 |
13 Sep 07 |
nicklas |
68 |
lineNumber=_LineNumber; |
11 |
13 Sep 07 |
nicklas |
69 |
fileName=_FileName; |
11 |
13 Sep 07 |
nicklas |
70 |
timeStamp=_TimeStamp; |
11 |
13 Sep 07 |
nicklas |
71 |
errorCode=_ErrorCode; |
11 |
13 Sep 07 |
nicklas |
72 |
} |
11 |
13 Sep 07 |
nicklas |
73 |
|
11 |
13 Sep 07 |
nicklas |
/** Constructor |
11 |
13 Sep 07 |
nicklas |
* Constructs a CalvinException object |
11 |
13 Sep 07 |
nicklas |
* Note: The time date stamp will be automatically set to the current time. |
11 |
13 Sep 07 |
nicklas |
77 |
* |
11 |
13 Sep 07 |
nicklas |
* @param _Source Typically will be the application name. Can also be the file sdk object type E.g. "Array File Reader". |
11 |
13 Sep 07 |
nicklas |
* @param _Description A brief message which describes what happened. |
11 |
13 Sep 07 |
nicklas |
* @param _ErrorCode An numeric value the is unique to this error/exception type |
11 |
13 Sep 07 |
nicklas |
81 |
*/ |
11 |
13 Sep 07 |
nicklas |
82 |
public CalvinException(String _Source, String _Description, long _ErrorCode) { |
11 |
13 Sep 07 |
nicklas |
83 |
sourceName = _Source; |
11 |
13 Sep 07 |
nicklas |
84 |
errorDescription=_Description; |
11 |
13 Sep 07 |
nicklas |
85 |
lineNumber=0; |
11 |
13 Sep 07 |
nicklas |
86 |
fileName=""; |
11 |
13 Sep 07 |
nicklas |
87 |
timeStamp=java.util.Calendar.getInstance().toString(); |
11 |
13 Sep 07 |
nicklas |
88 |
errorCode=_ErrorCode; |
11 |
13 Sep 07 |
nicklas |
89 |
} |
11 |
13 Sep 07 |
nicklas |
90 |
|
11 |
13 Sep 07 |
nicklas |
/** Constructor |
11 |
13 Sep 07 |
nicklas |
* Constructs a CalvinException object |
11 |
13 Sep 07 |
nicklas |
* Note: The time date stamp will be automatically set to the current time. |
11 |
13 Sep 07 |
nicklas |
94 |
* |
11 |
13 Sep 07 |
nicklas |
* @param _Description A brief message which describes what happened. |
11 |
13 Sep 07 |
nicklas |
* @param _ErrorCode An numeric value the is unique to this error/exception type |
11 |
13 Sep 07 |
nicklas |
97 |
*/ |
11 |
13 Sep 07 |
nicklas |
98 |
public CalvinException(String _Description, long _ErrorCode) { |
11 |
13 Sep 07 |
nicklas |
99 |
sourceName = ""; |
11 |
13 Sep 07 |
nicklas |
100 |
errorDescription=_Description; |
11 |
13 Sep 07 |
nicklas |
101 |
lineNumber=0; |
11 |
13 Sep 07 |
nicklas |
102 |
fileName=""; |
11 |
13 Sep 07 |
nicklas |
103 |
timeStamp=java.util.Calendar.getInstance().toString(); |
11 |
13 Sep 07 |
nicklas |
104 |
errorCode=_ErrorCode; |
11 |
13 Sep 07 |
nicklas |
105 |
} |
11 |
13 Sep 07 |
nicklas |
106 |
|
11 |
13 Sep 07 |
nicklas |
/** Constructor |
11 |
13 Sep 07 |
nicklas |
* Constructs a CalvinException object |
11 |
13 Sep 07 |
nicklas |
* Note: The time date stamp will be automatically set to the current time. |
11 |
13 Sep 07 |
nicklas |
110 |
* |
11 |
13 Sep 07 |
nicklas |
* @param _ErrorCode An numeric value the is unique to this error/exception type |
11 |
13 Sep 07 |
nicklas |
112 |
*/ |
11 |
13 Sep 07 |
nicklas |
113 |
public CalvinException(long _ErrorCode) { |
11 |
13 Sep 07 |
nicklas |
114 |
sourceName = ""; |
11 |
13 Sep 07 |
nicklas |
115 |
errorDescription=""; |
11 |
13 Sep 07 |
nicklas |
116 |
lineNumber=0; |
11 |
13 Sep 07 |
nicklas |
117 |
fileName=""; |
11 |
13 Sep 07 |
nicklas |
118 |
timeStamp=java.util.Calendar.getInstance().toString(); |
11 |
13 Sep 07 |
nicklas |
119 |
errorCode=_ErrorCode; |
11 |
13 Sep 07 |
nicklas |
120 |
} |
11 |
13 Sep 07 |
nicklas |
121 |
|
11 |
13 Sep 07 |
nicklas |
/** The source name associated with the exception. |
11 |
13 Sep 07 |
nicklas |
123 |
* |
11 |
13 Sep 07 |
nicklas |
* @return The source name associated with the exception. |
11 |
13 Sep 07 |
nicklas |
125 |
*/ |
11 |
13 Sep 07 |
nicklas |
126 |
public String getSource() { return sourceName; } |
11 |
13 Sep 07 |
nicklas |
127 |
|
11 |
13 Sep 07 |
nicklas |
/** The source name associated with the exception. |
11 |
13 Sep 07 |
nicklas |
129 |
* |
11 |
13 Sep 07 |
nicklas |
* @param value Source name associated with the exception. |
11 |
13 Sep 07 |
nicklas |
131 |
*/ |
11 |
13 Sep 07 |
nicklas |
132 |
public void setSource(String value) { sourceName = value; } |
11 |
13 Sep 07 |
nicklas |
133 |
|
11 |
13 Sep 07 |
nicklas |
/** The error description associated with the exception. |
11 |
13 Sep 07 |
nicklas |
135 |
* |
11 |
13 Sep 07 |
nicklas |
* @return The error description associated with the exception. |
11 |
13 Sep 07 |
nicklas |
137 |
*/ |
11 |
13 Sep 07 |
nicklas |
138 |
public String getDescription() { return errorDescription; } |
11 |
13 Sep 07 |
nicklas |
139 |
|
11 |
13 Sep 07 |
nicklas |
/** The error description associated with the exception. |
11 |
13 Sep 07 |
nicklas |
141 |
* |
11 |
13 Sep 07 |
nicklas |
* @param value Error description associated with the exception. |
11 |
13 Sep 07 |
nicklas |
143 |
*/ |
11 |
13 Sep 07 |
nicklas |
144 |
public void setDescription(String value) { errorDescription = value; } |
11 |
13 Sep 07 |
nicklas |
145 |
|
11 |
13 Sep 07 |
nicklas |
/** The error time stamp associated with the exception. |
11 |
13 Sep 07 |
nicklas |
147 |
* |
11 |
13 Sep 07 |
nicklas |
* @return The error time stamp associated with the exception. |
11 |
13 Sep 07 |
nicklas |
149 |
*/ |
11 |
13 Sep 07 |
nicklas |
150 |
public String getTimeStamp() { return timeStamp; } |
11 |
13 Sep 07 |
nicklas |
151 |
|
11 |
13 Sep 07 |
nicklas |
/** The error time stamp associated with the exception. |
11 |
13 Sep 07 |
nicklas |
153 |
* |
11 |
13 Sep 07 |
nicklas |
* @param value Error time stamp associated with the exception. |
11 |
13 Sep 07 |
nicklas |
155 |
*/ |
11 |
13 Sep 07 |
nicklas |
156 |
public void setTimeStamp(String value) { timeStamp = value; } |
11 |
13 Sep 07 |
nicklas |
157 |
|
11 |
13 Sep 07 |
nicklas |
/** The error source file name associated with the exception. |
11 |
13 Sep 07 |
nicklas |
159 |
* |
11 |
13 Sep 07 |
nicklas |
* @return The source file name associated with the exception. |
11 |
13 Sep 07 |
nicklas |
161 |
*/ |
11 |
13 Sep 07 |
nicklas |
162 |
public String getSourceFile() { return fileName; } |
11 |
13 Sep 07 |
nicklas |
163 |
|
11 |
13 Sep 07 |
nicklas |
/** The error source file name associated with the exception. |
11 |
13 Sep 07 |
nicklas |
165 |
* |
11 |
13 Sep 07 |
nicklas |
* @param value Source file name associated with the exception. |
11 |
13 Sep 07 |
nicklas |
167 |
*/ |
11 |
13 Sep 07 |
nicklas |
168 |
public void setSourceFile(String value) { fileName = value; } |
11 |
13 Sep 07 |
nicklas |
169 |
|
11 |
13 Sep 07 |
nicklas |
/** The error source line number associated with the exception. |
11 |
13 Sep 07 |
nicklas |
171 |
* |
11 |
13 Sep 07 |
nicklas |
* @return The source line number associated with the exception. |
11 |
13 Sep 07 |
nicklas |
173 |
*/ |
11 |
13 Sep 07 |
nicklas |
174 |
public short getLineNumber() { return lineNumber; } |
11 |
13 Sep 07 |
nicklas |
175 |
|
11 |
13 Sep 07 |
nicklas |
/** The error source line number associated with the exception. |
11 |
13 Sep 07 |
nicklas |
177 |
* |
11 |
13 Sep 07 |
nicklas |
* @param value Source line number associated with the exception. |
11 |
13 Sep 07 |
nicklas |
179 |
*/ |
11 |
13 Sep 07 |
nicklas |
180 |
public void setLineNumber(short value) { lineNumber = value; } |
11 |
13 Sep 07 |
nicklas |
181 |
|
11 |
13 Sep 07 |
nicklas |
/** The error code associated with the exception. |
11 |
13 Sep 07 |
nicklas |
183 |
* |
11 |
13 Sep 07 |
nicklas |
* @return The error code associated with the exception. |
11 |
13 Sep 07 |
nicklas |
185 |
*/ |
11 |
13 Sep 07 |
nicklas |
186 |
public long getErrorCode() { return errorCode; } |
11 |
13 Sep 07 |
nicklas |
187 |
|
11 |
13 Sep 07 |
nicklas |
/** The error code associated with the exception. |
11 |
13 Sep 07 |
nicklas |
189 |
* |
11 |
13 Sep 07 |
nicklas |
* @param value Error code associated with the exception. |
11 |
13 Sep 07 |
nicklas |
191 |
*/ |
11 |
13 Sep 07 |
nicklas |
192 |
public void setErrorCode(long value) { errorCode = value; } |
11 |
13 Sep 07 |
nicklas |
193 |
|
11 |
13 Sep 07 |
nicklas |
/** Returns a string describing the exception |
11 |
13 Sep 07 |
nicklas |
195 |
* |
11 |
13 Sep 07 |
nicklas |
* @return Returns a string describing the exception. |
11 |
13 Sep 07 |
nicklas |
197 |
*/ |
11 |
13 Sep 07 |
nicklas |
198 |
public String toString() { return ""; } |
11 |
13 Sep 07 |
nicklas |
199 |
|
11 |
13 Sep 07 |
nicklas |
200 |
} |