affyfusion-109/src/affymetrix/calvin/exception/CalvinException.java

Code
Comments
Other
Rev Date Author Line
11 13 Sep 07 nicklas 1
11 13 Sep 07 nicklas 2 /////////////////////////////////////////////////////////////////
11 13 Sep 07 nicklas 3 //
11 13 Sep 07 nicklas 4 // Copyright (C) 2005 Affymetrix, Inc.
11 13 Sep 07 nicklas 5 //
11 13 Sep 07 nicklas 6 // This library is free software; you can redistribute it and/or modify
11 13 Sep 07 nicklas 7 // it under the terms of the GNU Lesser General Public License as published
11 13 Sep 07 nicklas 8 // by the Free Software Foundation; either version 2.1 of the License,
11 13 Sep 07 nicklas 9 // or (at your option) any later version.
11 13 Sep 07 nicklas 10 //
11 13 Sep 07 nicklas 11 // This library is distributed in the hope that it will be useful, but
11 13 Sep 07 nicklas 12 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 13 Sep 07 nicklas 13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 13 Sep 07 nicklas 14 // for more details.
11 13 Sep 07 nicklas 15 //
11 13 Sep 07 nicklas 16 // You should have received a copy of the GNU Lesser General Public License
11 13 Sep 07 nicklas 17 // along with this library; if not, write to the Free Software Foundation, Inc.,
11 13 Sep 07 nicklas 18 // 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 24 /** 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 27     /** Source in the WIN32 use case is used for registry lookup to determine the resource file. 
11 13 Sep 07 nicklas 28             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 31     /** Message for the exception */
11 13 Sep 07 nicklas 32     protected String errorDescription;
11 13 Sep 07 nicklas 33     /** Date/Time stamp of exception */
11 13 Sep 07 nicklas 34     protected String timeStamp;
11 13 Sep 07 nicklas 35     /** File the exception occured in */
11 13 Sep 07 nicklas 36     protected String fileName;
11 13 Sep 07 nicklas 37     /** Line number that the exception occured */
11 13 Sep 07 nicklas 38     protected short lineNumber;
11 13 Sep 07 nicklas 39     /** 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 43     /** Constructor
11 13 Sep 07 nicklas 44     * 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 55     /** Constructor
11 13 Sep 07 nicklas 56     * Constructs a CalvinException object.
11 13 Sep 07 nicklas 57     *
11 13 Sep 07 nicklas 58     * @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 59     * @param _Description A brief message which describes what happened.
11 13 Sep 07 nicklas 60     * @param _TimeStamp Time and date the exception occured.
11 13 Sep 07 nicklas 61     * @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 62     * @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 63     * @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 74     /** Constructor
11 13 Sep 07 nicklas 75     * Constructs a CalvinException object
11 13 Sep 07 nicklas 76     * Note: The time date stamp will be automatically set to the current time.
11 13 Sep 07 nicklas 77     *
11 13 Sep 07 nicklas 78     * @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 79     * @param _Description A brief message which describes what happened.
11 13 Sep 07 nicklas 80     * @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 91     /** Constructor
11 13 Sep 07 nicklas 92     * Constructs a CalvinException object
11 13 Sep 07 nicklas 93     * Note: The time date stamp will be automatically set to the current time.
11 13 Sep 07 nicklas 94     *
11 13 Sep 07 nicklas 95     * @param _Description A brief message which describes what happened.
11 13 Sep 07 nicklas 96     * @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 107     /** Constructor
11 13 Sep 07 nicklas 108     * Constructs a CalvinException object
11 13 Sep 07 nicklas 109     * Note: The time date stamp will be automatically set to the current time.
11 13 Sep 07 nicklas 110     *
11 13 Sep 07 nicklas 111     * @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 122     /** The source name associated with the exception.
11 13 Sep 07 nicklas 123     *
11 13 Sep 07 nicklas 124     * @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 128     /** The source name associated with the exception.
11 13 Sep 07 nicklas 129     *
11 13 Sep 07 nicklas 130     * @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 134     /** The error description associated with the exception.
11 13 Sep 07 nicklas 135     *
11 13 Sep 07 nicklas 136     * @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 140     /** The error description associated with the exception.
11 13 Sep 07 nicklas 141     *
11 13 Sep 07 nicklas 142     * @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 146     /** The error time stamp associated with the exception.
11 13 Sep 07 nicklas 147     *
11 13 Sep 07 nicklas 148     * @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 152     /** The error time stamp associated with the exception.
11 13 Sep 07 nicklas 153     *
11 13 Sep 07 nicklas 154     * @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 158     /** The error source file name associated with the exception.
11 13 Sep 07 nicklas 159     *
11 13 Sep 07 nicklas 160     * @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 164     /** The error source file name associated with the exception.
11 13 Sep 07 nicklas 165     *
11 13 Sep 07 nicklas 166     * @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 170     /** The error source line number associated with the exception.
11 13 Sep 07 nicklas 171     *
11 13 Sep 07 nicklas 172     * @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 176     /** The error source line number associated with the exception.
11 13 Sep 07 nicklas 177     *
11 13 Sep 07 nicklas 178     * @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 182     /** The error code associated with the exception.
11 13 Sep 07 nicklas 183     *
11 13 Sep 07 nicklas 184     * @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 188     /** The error code associated with the exception.
11 13 Sep 07 nicklas 189     *
11 13 Sep 07 nicklas 190     * @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 194     /** Returns a string describing the exception
11 13 Sep 07 nicklas 195     *
11 13 Sep 07 nicklas 196     * @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 }