Statistics
| Revision:

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 @ 43925

History | View | Annotate | Download (3.68 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
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
 * as published by the Free Software Foundation; either version 3
9
 * 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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.export;
25

    
26
import org.gvsig.fmap.dal.feature.Feature;
27
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
public class ExportException extends BaseException {
40

    
41
    private static final long serialVersionUID = 6756475060924237176L;
42

    
43
    private static final String MESSAGE =
44
        "An error has been produced in the export process";
45

    
46
    private static final String KEY = "_ExportException";
47
    private Feature feature;
48

    
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
    public ExportException() {
55
        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
    public ExportException(Exception cause) {
69
        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
    protected ExportException(String message, String key, long code) {
82
        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
    protected ExportException(String message, Throwable cause, String key,
97
        long code) {
98
        super(message, cause, key, code);
99
    }
100

    
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
}