svn-gvsig-desktop / tags / v1_0_2_Build_913 / libraries / libFMap / src / com / iver / cit / gvsig / fmap / DriverException.java @ 11431
History | View | Annotate | Download (3.41 KB)
1 | 1100 | fjp | /* 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 | 656 | fernando | package com.iver.cit.gvsig.fmap; |
42 | |||
43 | 8765 | jjdelcerro | import com.iver.utiles.ExceptionDescription; |
44 | import com.iver.utiles.IDescriptableException; |
||
45 | |||
46 | 656 | fernando | /**
|
47 | 1034 | vcaballero | * Excepci?n que indica un problema con los drivers. El problema concreto viene
|
48 | * dado por la excepci?n hija
|
||
49 | 656 | fernando | */
|
50 | 8765 | jjdelcerro | 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 | 656 | fernando | /**
|
65 | 8765 | jjdelcerro | * 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 | 1034 | vcaballero | * Crea un nuevo DriverException
|
74 | *
|
||
75 | 846 | fernando | * @param message
|
76 | */
|
||
77 | public DriverException(String message) { |
||
78 | super(message);
|
||
79 | 1034 | vcaballero | } |
80 | 8765 | jjdelcerro | |
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 | 846 | fernando | |
112 | /**
|
||
113 | 1034 | vcaballero | * Crea un nuevo DriverException
|
114 | *
|
||
115 | 846 | fernando | * @param message
|
116 | * @param cause
|
||
117 | */
|
||
118 | public DriverException(String message, Throwable cause) { |
||
119 | super(message, cause);
|
||
120 | 1034 | vcaballero | } |
121 | 846 | fernando | |
122 | /**
|
||
123 | 1034 | vcaballero | * Crea un nuevo DriverException
|
124 | 656 | fernando | *
|
125 | * @param cause
|
||
126 | */
|
||
127 | public DriverException(Throwable cause) { |
||
128 | super(cause);
|
||
129 | } |
||
130 | 8765 | jjdelcerro | |
131 | public DriverException(Throwable cause, ExceptionDescription type){ |
||
132 | super(cause);
|
||
133 | this.exceptionType = type;
|
||
134 | } |
||
135 | 656 | fernando | } |