Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libTools / src / org / gvsig / tools / exception / IBaseException.java @ 31544

History | View | Annotate | Download (3.98 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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
 */
22

    
23
/*
24
 * AUTHORS (In addition to CIT):
25
 */
26
package org.gvsig.tools.exception;
27

    
28
import java.util.Iterator;
29

    
30
/**
31
 *
32
 *
33
 * @author Equipo de desarrollo de gvSIG
34
 *
35
 */
36
public interface IBaseException {
37

    
38
        /**
39
         *  Returns the message that describes the exception.
40
         *
41
         *  @return The message.
42
         */
43
        public String getMessage();
44

    
45
        /**
46
         *  Returns the message that describes the exception, with indentation.
47
         *
48
         *  @param indent Quantity of blanks to insert
49
         *         at the start of the message.
50
         *  @return The message with indentation.
51
         */
52
        public String getMessage(int indent);
53

    
54
        /**
55
         *  Returns the translated message that describes the exception.
56
         *
57
         *  @return The translated message with indentation.
58
         */
59
        public String getLocalizedMessage();
60

    
61
        /**
62
         *  Returns the translated message that
63
         *  describes the exception with indentation.
64
         *
65
         *  @param translator Instance of a class that fulfills
66
         *         the IExceptionTranslator interface.
67
         *         His method "getText" takes charge returning
68
         *         the expression, correspondent to the key that
69
         *         delivers him, translated into the configured language.
70
         *  @param indent Quantity of blanks to insert
71
         *         at the start of the message.
72
         *  @return The translated message with indentation.
73
         */
74
        public String getLocalizedMessage(ExceptionTranslator translator, int indent);
75

    
76
        /**
77
         *  Crosses the exceptions chained through cause to conform
78
         *  the message.
79
         *
80
         *  @return The compound message with all the messages
81
         *          of the stack of exceptions.
82
         */
83
        public String getMessageStack();
84

    
85
        /**
86
         *  Crosses the exceptions chained through cause to conform
87
         *  the compound message with indentation.
88
         *
89
         *  @param indent Quantity of blanks to insert
90
         *         at the start of the messages.
91
         *  @return The compound message with all the messages
92
         *          of the stack of exceptions.
93

94
         */
95
        public String getMessageStack(int indent);
96

    
97
        /**
98
         *  Crosses the exceptions chained through cause
99
         *  to conform the compound message in the corresponding language.
100
         *
101
         *  @return The translated compound message.
102
         *
103
         */
104
        public String getLocalizedMessageStack();
105

    
106
        /**
107
         *  Crosses the exceptions chained through cause
108
         *  to conform the compound message in the corresponding language.
109
         *
110
         *  @param translator Instance of a class that fulfills
111
         *         the IExceptionTranslator interface.
112
         *         His method "getText" takes charge returning
113
         *         the expression, correspondent to the key that
114
         *         delivers him, translated into the configured language.
115
         *  @param indent Quantity of blanks to insert
116
         *         at the start of the messages.
117
         *  @return The translated message with indentation.
118
         *
119
         */
120
        public String getLocalizedMessageStack(ExceptionTranslator translator,
121
                        int indent);
122

    
123

    
124
        /**
125
         *  @return The exception's code.
126
         */
127
        public long getCode();
128

    
129
        /**
130
         *  @return The format string.
131
         */
132
        public String getFormatString();
133

    
134
        /**
135
         *  @return The message key associated to the exception.
136
         */
137
        public String getMessageKey();
138

    
139
        /**
140
         *  @return A iterator for the chained exceptions.
141
         */
142
        public Iterator iterator();
143

    
144
}