svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.exportto / org.gvsig.exportto.lib / org.gvsig.exportto.lib.api / src / main / java / org / gvsig / export / ExportException.java @ 44069
History | View | Annotate | Download (3.68 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40435 | jjdelcerro | *
|
4 | 40559 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | 40435 | jjdelcerro | *
|
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | 40559 | jjdelcerro | * as published by the Free Software Foundation; either version 3
|
9 | 40435 | jjdelcerro | * of the License, or (at your option) any later version.
|
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | 40559 | jjdelcerro | * For any additional information, do not hesitate to contact us
|
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 40435 | jjdelcerro | */
|
24 | 43925 | jjdelcerro | package org.gvsig.export; |
25 | 40435 | jjdelcerro | |
26 | 43925 | jjdelcerro | import org.gvsig.fmap.dal.feature.Feature; |
27 | 40435 | jjdelcerro | import org.gvsig.tools.exception.BaseException; |
28 | |||
29 | /**
|
||
30 | * Generic exception thrown in the Exportto API when the exception or error
|
||
31 | * may be dealt by the program or the user of the program which is a client of
|
||
32 | * the Exportto API.
|
||
33 | *
|
||
34 | * @see {@link ExporttoService}
|
||
35 | * @see {@link ExporttoManager}
|
||
36 | * @author gvSIG team.
|
||
37 | * @version $Id$
|
||
38 | */
|
||
39 | 43925 | jjdelcerro | public class ExportException extends BaseException { |
40 | 40435 | jjdelcerro | |
41 | private static final long serialVersionUID = 6756475060924237176L; |
||
42 | |||
43 | private static final String MESSAGE = |
||
44 | 43925 | jjdelcerro | "An error has been produced in the export process";
|
45 | 40435 | jjdelcerro | |
46 | 43925 | jjdelcerro | private static final String KEY = "_ExportException"; |
47 | private Feature feature;
|
||
48 | 40435 | jjdelcerro | |
49 | /**
|
||
50 | * Constructor to be used in rare cases, usually you must create a new child
|
||
51 | * exception class for each case.
|
||
52 | * <strong>Don't use this constructor in child classes.</strong>
|
||
53 | */
|
||
54 | 43925 | jjdelcerro | public ExportException() { |
55 | 40435 | jjdelcerro | super(MESSAGE, KEY, serialVersionUID);
|
56 | } |
||
57 | |||
58 | /**
|
||
59 | * Constructor to be used in rare cases, usually you must create a new child
|
||
60 | * exception class for each case.
|
||
61 | * <p>
|
||
62 | * <strong>Don't use this constructor in child classes.</strong>
|
||
63 | * </p>
|
||
64 | *
|
||
65 | * @param cause
|
||
66 | * the original cause of the exception
|
||
67 | */
|
||
68 | 43925 | jjdelcerro | public ExportException(Exception cause) { |
69 | 40435 | jjdelcerro | super(MESSAGE, cause, KEY, serialVersionUID);
|
70 | } |
||
71 | |||
72 | /**
|
||
73 | * @see BaseException#BaseException(String, String, long).
|
||
74 | * @param message
|
||
75 | * the default messageFormat to describe the exception
|
||
76 | * @param key
|
||
77 | * the key to use to search a localized messageFormnata
|
||
78 | * @param code
|
||
79 | * the unique code to identify the exception
|
||
80 | */
|
||
81 | 43925 | jjdelcerro | protected ExportException(String message, String key, long code) { |
82 | 40435 | jjdelcerro | super(message, key, code);
|
83 | } |
||
84 | |||
85 | /**
|
||
86 | * @see BaseException#BaseException(String, Throwable, String, long).
|
||
87 | * @param message
|
||
88 | * the default messageFormat to describe the exception
|
||
89 | * @param cause
|
||
90 | * the original cause of the exception
|
||
91 | * @param key
|
||
92 | * the key to use to search a localized messageFormnata
|
||
93 | * @param code
|
||
94 | * the unique code to identify the exception
|
||
95 | */
|
||
96 | 43925 | jjdelcerro | protected ExportException(String message, Throwable cause, String key, |
97 | 40435 | jjdelcerro | long code) {
|
98 | super(message, cause, key, code);
|
||
99 | } |
||
100 | 43925 | jjdelcerro | |
101 | public ExportException(Exception e, Feature feature) { |
||
102 | this(e);
|
||
103 | this.feature = feature;
|
||
104 | } |
||
105 | |||
106 | public ExportException(String message, Feature feature) { |
||
107 | super(message, null, message, serialVersionUID); |
||
108 | this.feature = feature;
|
||
109 | } |
||
110 | |||
111 | public Feature getFeature() {
|
||
112 | return this.feature; |
||
113 | } |
||
114 | |||
115 | 40435 | jjdelcerro | } |