Statistics
| Revision:

root / branches / Mobile1.0 / org.gvsig.gpe / src / org / gvsig / gpe / parser / GPEErrorHandler.java @ 79

History | View | Annotate | Download (3.22 KB)

1
package org.gvsig.gpe.parser;
2

    
3
import java.util.ArrayList;
4

    
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
/* CVS MESSAGES:
46
 *
47
 * $Id: GPEErrorHandler.java 153 2007-06-20 09:35:37Z jorpiell $
48
 * $Log$
49
 * Revision 1.6  2007/06/20 09:35:37  jorpiell
50
 * Add the javadoc comments
51
 *
52
 * Revision 1.5  2007/05/16 09:27:24  jorpiell
53
 * Added two arrays to manage exceptions
54
 *
55
 * Revision 1.4  2007/04/19 07:23:20  jorpiell
56
 * Add the add methods to teh contenhandler and change the register mode
57
 *
58
 * Revision 1.3  2007/04/17 07:53:55  jorpiell
59
 * Before to start a new parsing process, the initialize method of the content handlers is throwed
60
 *
61
 * Revision 1.2  2007/04/12 17:06:42  jorpiell
62
 * First GML writing tests
63
 *
64
 * Revision 1.1  2007/04/11 08:46:21  csanchez
65
 * Actualizacion protoripo libGPE
66
 *
67
 *
68
 */
69
/**
70
 * This class is a common implementation for all
71
 * the application error handlers.
72
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
73
 * @author Carlos S?nchez Peri??n (sanchez_carper@gva.es)
74
 */
75
public abstract class GPEErrorHandler implements IGPEErrorHandler {
76
        private ArrayList errors = null;
77
        private ArrayList warnings = null;
78
                
79
        public GPEErrorHandler() {
80
                super();
81
                errors = new ArrayList();
82
                warnings = new ArrayList();
83
        }
84
        
85
        /*
86
         * (non-Javadoc)
87
         * @see org.gvsig.gpe.IGPEErrorHandler#addError(java.lang.Throwable)
88
         */
89
        public void addError(Throwable e) {
90
                errors.add(e);                        
91
        }
92

    
93
        /*
94
         * (non-Javadoc)
95
         * @see org.gvsig.gpe.IGPEErrorHandler#addWarning(java.lang.Throwable)
96
         */
97
        public void addWarning(Throwable e) {
98
                warnings.add(e);                
99
        }
100

    
101
        /**
102
         * @return the errors size
103
         */
104
        public int getErrorsSize() {
105
                return errors.size();
106
        }
107

    
108
        /**
109
         * @return the warnings size
110
         */
111
        public int getWarningsSize() {
112
                return warnings.size();
113
        }
114
        
115
        /**
116
         * Get a error
117
         * @param i
118
         * Error position
119
         * @return
120
         * The exception
121
         */
122
        public Throwable getErrorAt(int i) {
123
                return (Throwable)errors.get(i);
124
        }
125

    
126
        /**
127
         * Get a warning
128
         * @param i
129
         * Warning position
130
         * @return
131
         * The warning exception
132
         */
133
        public Throwable getWarningAt(int i) {
134
                return (Throwable) warnings.get(i);
135
        }        
136

    
137
}