Statistics
| Revision:

svn-gvsig-desktop / branches / v10 / libraries / libIverUtiles / src / com / iver / utiles / ExceptionDescription.java @ 20100

History | View | Annotate | Download (5.39 KB)

1
/*
2
 * Created on 01-sep-2006
3
 *
4
 * gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
5
 *
6
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
7
 *
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation; either version 2
11
 * of the License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
21
 *
22
 * For more information, contact:
23
 *
24
 *  Generalitat Valenciana
25
 *   Conselleria d'Infraestructures i Transport
26
 *   Av. Blasco Ib??ez, 50
27
 *   46010 VALENCIA
28
 *   SPAIN
29
 *
30
 *      +34 963862235
31
 *   gvsig@gva.es
32
 *      www.gvsig.gva.es
33
 *
34
 *    or
35
 *
36
 *   IVER T.I. S.A
37
 *   Salamanca 50
38
 *   46005 Valencia
39
 *   Spain
40
 *
41
 *   +34 963163400
42
 *   dac@iver.es
43
 */
44
/* CVS MESSAGES:
45
 *
46
 * $Id: ExceptionDescription.java 20100 2008-04-14 09:34:45Z jmvivo $
47
 * $Log$
48
 * Revision 1.2.2.1  2006-11-15 04:11:13  jjdelcerro
49
 * *** empty log message ***
50
 *
51
 * Revision 1.2  2006/09/22 08:08:04  ldiaz
52
 * layerName y driverName gestionados/almacenados desde esta clase
53
 *
54
 * Revision 1.1  2006/09/21 17:04:52  azabala
55
 * First version in cvs
56
 *
57
 *
58
 */
59
package com.iver.utiles;
60

    
61
/**
62
 * <p>Most exceptions produced in a layer, has common information (layer name, driver name, error description, error code).</p>
63
 * 
64
 * <p>An <code>ExceptionDescription</code> can provide this extra information describing the cause of the
65
 *  error, and more useful information to give to the user that works with a layer.<p>
66
 * 
67
 * @author azabala
68
 */
69
public abstract class ExceptionDescription {
70
        /**
71
         * <p>Code which identifies the kind of error which is the cause of this exception.</p>
72
         */
73
        private int errorCode;
74

    
75
        /**
76
         * <p>A description about the error which produced this exception.</p>
77
         */
78
        private String errorDescription;
79

    
80
        /**
81
         * <p>If this exception was produced using a driver, this attribute describes that driver.</p>
82
         */
83
        private String driverName;
84

    
85
        /**
86
         * <p>If this exception was produced using a layer, this attribute describes that layer.</p> 
87
         */
88
        private String layerName;
89
        
90
        /**
91
         * <p>Gets the name of the driver (if a driver was using) which this exception was produced.</p>
92
         * 
93
         * @return the name of the driver (if a driver was using) which this exception was produced
94
         */
95
        public String getDriverName() {
96
                return driverName;
97
        }
98

    
99
        /**
100
         * <p>Sets the name of the driver (if a driver was using) which this exception was produced.</p>
101
         * 
102
         * @param driverName the name of the driver (if a driver was using) which this exception was produced
103
         */
104
        public void setDriverName(String driverName){
105
                this.driverName = driverName;
106
        }        
107

    
108
        /**
109
         * <p>Gets the name of the layer (if a layer was using) with that this exception was produced.</p>
110
         * 
111
         * @return the name of the layer (if a layer was using) with that this exception was produced
112
         */
113
        public String getLayerName() {
114
                return driverName;
115
        }
116

    
117
        /**
118
         * <p>Sets the name of the layer (if a layer was using) with that this exception was produced.</p>
119
         * 
120
         * @param layerName the name of the layer (if a layer was using) with that this exception was produced
121
         */
122
        public void setLayerName(String layerName){
123
                this.layerName = layerName;
124
        }        
125

    
126
        /**
127
         * <p>Creates a new <code>ExceptionDescription</code> with no value initialized.</p>
128
         */
129
        public ExceptionDescription() {
130
        }
131

    
132
        /**
133
         * <p>Creates a new <code>ExceptionDescription</code> with the useful values initialized.</p>
134
         * 
135
         * @param errorCode code which identifies the kind of error which is the cause of this exception
136
         * @param errorDescription description about the error which produced this exception
137
         */
138
        public ExceptionDescription(int errorCode, String errorDescription) {
139
                this.errorCode = errorCode;
140
                this.errorDescription = errorDescription;
141
        }
142

    
143
        /**
144
         * <p>Sets the code which identifies the kind of error which is the cause of this exception.</p>
145
         * 
146
         * @param errorCode code which identifies the kind of error which is the cause of this exception
147
         */
148
        public void setCode(int errorCode) {
149
                this.errorCode = errorCode;
150
        }
151

    
152
        /**
153
         * <p>Sets the description about the error which produced this exception.</p>
154
         * 
155
         * @param description description about the error which produced this exception
156
         */
157
        public void setDescription(String description) {
158
                this.errorDescription = description;
159
        }
160

    
161
        /**
162
         * <p>Gets the code which identifies the kind of error which is the cause of this exception.</p>
163
         * 
164
         * @return code which identifies the kind of error which is the cause of this exception
165
         */
166
        public int getErrorCode() {
167
                return errorCode;
168
        }
169

    
170
        /**
171
         * <p>Gets the description about the error which produced this exception.</p>
172
         * 
173
         * @return description about the error which produced this exception
174
         */
175
        public String getErrorDescription() {
176
                return errorDescription;
177
        }
178

    
179
        /**
180
         * <p>Returns a message that describes the error which produced this exception, formatted in HTML code.</p>
181
         * 
182
         * @return message that describes the error which produced this exception, formatted in HTML code
183
         */
184
        public abstract String getHtmlErrorMessage();
185

    
186
}