svn-gvsig-desktop / tags / v1_0_2_Build_908 / libraries / libFMap / src / com / iver / cit / gvsig / fmap / DriverException.java @ 11054
History | View | Annotate | Download (3.41 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Ib??ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
package com.iver.cit.gvsig.fmap; |
42 |
|
43 |
import com.iver.utiles.ExceptionDescription; |
44 |
import com.iver.utiles.IDescriptableException; |
45 |
|
46 |
/**
|
47 |
* Excepci?n que indica un problema con los drivers. El problema concreto viene
|
48 |
* dado por la excepci?n hija
|
49 |
*/
|
50 |
public class DriverException extends Exception implements IDescriptableException{ |
51 |
|
52 |
/*
|
53 |
* azabala.
|
54 |
* El problema que tenemos es que una DriverException puede ser debida
|
55 |
* a multiples causas, y para poder mostrar al usuario informaci?n de cara
|
56 |
* a que subsane estas causas (sobretodo considerando el estado UnAvalaible
|
57 |
* de un FLayer) seria necesario hacer un analisis exhaustivo de estas causas.
|
58 |
*
|
59 |
* Por este motivo a?ado un ExceptionDescription a DriverException
|
60 |
* (si finalmente DriverIOException tb lo requiere, habr?a que meter herencias)
|
61 |
* que S? que tiene esta inforamaci?n.
|
62 |
*
|
63 |
*/
|
64 |
/**
|
65 |
* It has information about the cause of the DriverException
|
66 |
* (and an error message to the user)
|
67 |
*/
|
68 |
private ExceptionDescription exceptionType;
|
69 |
|
70 |
|
71 |
|
72 |
/**
|
73 |
* Crea un nuevo DriverException
|
74 |
*
|
75 |
* @param message
|
76 |
*/
|
77 |
public DriverException(String message) { |
78 |
super(message);
|
79 |
} |
80 |
|
81 |
public DriverException(String message, ExceptionDescription type){ |
82 |
super(message);
|
83 |
this.exceptionType = type;
|
84 |
} |
85 |
|
86 |
/**
|
87 |
* New constructor to specify ExceptionDescription
|
88 |
* @param message
|
89 |
* @param cause
|
90 |
* @param exceptionType
|
91 |
*/
|
92 |
public DriverException(String message, |
93 |
Throwable cause,
|
94 |
ExceptionDescription exceptionType){ |
95 |
super(message, cause);
|
96 |
this.exceptionType = exceptionType;
|
97 |
} |
98 |
|
99 |
/**
|
100 |
* Returns the ExceptionDescription associated to this DriverException
|
101 |
* @return
|
102 |
*/
|
103 |
public ExceptionDescription getExceptionType(){
|
104 |
if(exceptionType != null) |
105 |
return exceptionType;
|
106 |
else return null; |
107 |
// else
|
108 |
// return ExceptionDescription.getType("GENERIC");
|
109 |
} |
110 |
|
111 |
|
112 |
/**
|
113 |
* Crea un nuevo DriverException
|
114 |
*
|
115 |
* @param message
|
116 |
* @param cause
|
117 |
*/
|
118 |
public DriverException(String message, Throwable cause) { |
119 |
super(message, cause);
|
120 |
} |
121 |
|
122 |
/**
|
123 |
* Crea un nuevo DriverException
|
124 |
*
|
125 |
* @param cause
|
126 |
*/
|
127 |
public DriverException(Throwable cause) { |
128 |
super(cause);
|
129 |
} |
130 |
|
131 |
public DriverException(Throwable cause, ExceptionDescription type){ |
132 |
super(cause);
|
133 |
this.exceptionType = type;
|
134 |
} |
135 |
} |