Statistics
| Revision:

root / trunk / libraries / libGPE / src / org / gvsig / gpe / parser / IGPEContentHandler.java @ 21998

History | View | Annotate | Download (14 KB)

1
package org.gvsig.gpe.parser;
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
*
4
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
*
20
* For more information, contact:
21
*
22
*  Generalitat Valenciana
23
*   Conselleria d'Infraestructures i Transport
24
*   Av. Blasco Ib??ez, 50
25
*   46010 VALENCIA
26
*   SPAIN
27
*
28
*      +34 963862235
29
*   gvsig@gva.es
30
*      www.gvsig.gva.es
31
*
32
*    or
33
*
34
*   IVER T.I. S.A
35
*   Salamanca 50
36
*   46005 Valencia
37
*   Spain
38
*
39
*   +34 963163400
40
*   dac@iver.es
41
*/
42
/* CVS MESSAGES:
43
*
44
* $Id: IGPEContentHandler.java 202 2007-11-27 12:00:11Z jpiera $
45
* $Log$
46
* Revision 1.18  2007/06/20 09:35:37  jorpiell
47
* Add the javadoc comments
48
*
49
* Revision 1.17  2007/06/19 10:34:51  jorpiell
50
* Add some comments and creates a warning when an operation is not supported
51
*
52
*
53
*/
54
/**
55
 * This interface defines the "contract" between the consumer
56
 * application and libGPE. It has methods that will be invoke
57
 * by the parser every time that an event happens
58
 * @author Jorge Piera Llodr? (jorge.piera@iver.es)
59
 * @author Carlos S?nchez Peri??n (sanchez_carper@gva.es)
60
 */
61
public interface IGPEContentHandler extends IGPEContentHandlerSFP0{
62
        
63
        /**
64
         * This method is thrown when the parser find a new 
65
         * bounding box.
66
         * @param id
67
         * Bounding box identifier
68
         * @param coords
69
         * A coordinates iterator
70
         * @param srs
71
         * Spatial reference system
72
         * @return
73
         * The consumer application object that represents
74
         *  a bounding box
75
         */
76
        public Object startBbox(String id, ICoordinateIterator coords, String srs);
77
        
78
        /**
79
         * This method indicates that the parser thas finished to
80
         * parse the bounding box.
81
         * @param bbox
82
         * The consumer application object that represents a
83
         * bounding box
84
         */
85
        public void endBbox(Object bbox);
86
        
87
        /**
88
         * It is thrown every time that a new layer is detected.
89
         * @param id
90
         * Layer identifier
91
         * @param namespace
92
         * XML namespace
93
         * @param name
94
         * Layer name
95
         * @param description
96
         * Layer description
97
         * @param srs
98
         * Layer spatial reference system
99
         * @param parentLayer
100
         * Layer that contains it
101
         * @param bBox
102
         * Layer bounding box
103
         * @return
104
         * The consumer application object that represents a layer
105
         */
106
        public Object startLayer(String id,  String namespace, String name, String description, 
107
                        String srs, Object parentLayer, Object bBox);
108

    
109
        /**
110
         * It is thrown when a layer has been finished to parse.
111
         * @param layer
112
         * The consumer application object that represents a layer
113
         */
114
        public void endLayer(Object layer);
115
        
116
        /**
117
         * It adds a name to one layer that has been previously 
118
         * created using the startLayer method.
119
         * @param name
120
         * Layer name
121
         * @param layer
122
         * The consumer application object that represents a layer
123
         */
124
        public void addNameToLayer(String name, Object layer);
125
        
126
        /**
127
         * It adds the description to one layer that has been previously 
128
         * created using the startLayer method.
129
         * @param description
130
         * Layer description
131
         * @param layer
132
         * The consumer application object that represents a layer
133
         */
134
        public void addDescriptionToLayer(String description, Object layer);
135
        
136
        /**
137
         * It adds a spatial reference system to one layer that 
138
         * has been previously created using the startLayer method.
139
         * @param srs
140
         * Spatial reference system
141
         * @param layer
142
         * The consumer application object that represents a layer
143
         */
144
        public void addSrsToLayer(String srs, Object Layer);
145
        
146
        /**
147
         * It establish the relationship parent-child between two layers
148
         * that have been previously created using the startLayer method.
149
         * @param parent
150
         * The consumer application object that represents the parent layer
151
         * @param layer
152
         * The consumer application object that represents the child layer
153
         */
154
        public void addParentLayerToLayer(Object parent, Object layer);
155
        
156
        /**
157
         * It adds a bounding box to one layer that  has been previously 
158
         * created using the startLayer method.
159
         * @param bbox
160
         * Layer bounding box
161
         * @param layer
162
         * The consumer application object that represents a layer
163
         */
164
        public void addBboxToLayer(Object bbox, Object layer);
165
                
166
        /**
167
         * It is thrown when the parser has found a new feature.
168
         * @param id
169
         * Feature identifier
170
         * @param name
171
         * Feature name
172
         * @param namespace
173
         * XML namespace
174
         * @param layer
175
         * Consumer application object that represents a layer
176
         * @return
177
         * Consumer application object that represents a feature
178
         */
179
        public Object startFeature(String id, String namespace, String name, Object layer);
180
        
181
        /**
182
         * This method is thrown when the parser has finished to
183
         * parse a feature.
184
         * @param feature
185
         * Consumer application object that represents a feature
186
         */
187
        public void endFeature(Object feature);
188
        
189
        /**
190
         * This method adds a name to one layer that has been
191
         * previously created using the startFeature method. 
192
         * @param name
193
         * Feature name
194
         * @param feature
195
     * Consumer application object that represents a feature
196
         */
197
        public void addNameToFeature(String name, Object feature);        
198

    
199
        /**
200
         * This method adds a feature to one layer that has been 
201
         * previously created using the startLayer method. 
202
         * @param feature
203
         * Consumer application object that represents a feature
204
         * @param layer
205
         * Consumer application object that represents a layer
206
         */
207
        public void addFeatureToLayer(Object feature, Object layer);
208
                
209
        /**
210
         * It is thrown when the parser has found a new element
211
         * @param namespace
212
         * XML namespace
213
         * @param name
214
         * Element name
215
         * @param value
216
         * Element value
217
         * @param parentElement
218
         * The parent of this element (if exists)
219
         * @return
220
         * Consumer application object that represents an element 
221
         */
222
        public Object startElement(String namespace, String name, Object value, Object parentElement);
223
                
224
        /**
225
         * This method is thrown when the parser find the end 
226
         * of an element.
227
         * @param element
228
         * Consumer application object that represents an element 
229
         */
230
        public void endElement(Object element);
231
        
232
        /**
233
         * It is thrown to establish a relationship parent-child
234
         * between two elements.
235
         * @param parent
236
         * Consumer application object that represents the parent element 
237
         * @param element
238
         * Consumer application object that represents the child element 
239
         */
240
        public void addParentElementToElement(Object parent, Object element);
241
        
242
        /**
243
         * This method adds an element to one feature that has been 
244
         * previously created using the startFeature method
245
         * @param element
246
         * Consumer application object that represents an element 
247
         * @param feature
248
         * Consumer application object that represents the feature 
249
         */
250
        public void addElementToFeature(Object element, Object feature);
251
        
252
        /**
253
         * This method indicates that the parser has found a point. 
254
         * @param id
255
         * Point identifier
256
         * @param coords
257
         * A coordinates iterator
258
         * @param srs
259
         * Spatial reference system
260
         * @return
261
         * Consumer application object that represents a point 
262
         */
263
        public Object startPoint(String id, ICoordinateIterator coords, String srs);
264
        
265
        /**
266
         * It is thrown when the point has been completely parsed.
267
         * @param point
268
         * Consumer application object that represents a point 
269
         */
270
        public void endPoint(Object point);
271
        
272
        /**
273
         * This method indicates that the parser has found a lineString. 
274
         * @param id
275
         * LineString identifier
276
         * @param coords
277
         * A coordinates iterator
278
         * @param srs
279
         * Spatial reference system
280
         * @return
281
         * Consumer application object that represents a lineString 
282
         */
283
        public Object startLineString( String id, ICoordinateIterator coords, String srs);
284
        
285
        /**
286
     * It is thrown when the lineString has been completely parsed.
287
         * @param lineString
288
         * Consumer application object that represents a lineString 
289
         */
290
        public void endLineString(Object lineString);
291
        
292
        /**
293
         * This method indicates that the parser has found a linearRing. 
294
         * @param id
295
         * LinearRing identifier
296
         * @param coords
297
         * A coordinates iterator
298
         * @param srs
299
         * Spatial reference system
300
         * @return
301
         * Consumer application object that represents a linarRing 
302
         */
303
        public Object startLinearRing(String id, ICoordinateIterator coords, String srs);
304
        
305
        /**
306
         * It is thrown when the linearRing has been completely parsed.
307
         * @param linearRing
308
         * Consumer application object that represents a linearRing 
309
         */
310
        public void endLinearRing(Object linearRing);
311
        
312
        /**
313
         * This method indicates that the parser has found a polygon. 
314
         * @param id
315
         * Polygon identifier
316
         * @param coords
317
         * A coordinates iterator
318
         * @param srs
319
         * Spatial reference system
320
         * @return
321
         * Consumer application object that represents a polygon 
322
         */
323
        public Object startPolygon(String id, ICoordinateIterator coords, String srs);
324
        
325
        /**
326
         * It is thrown when the polygon has been completely parsed.
327
         * @param polygon
328
         * Consumer application object that represents a polygon 
329
         */
330
        public void endPolygon(Object polygon);        
331
        
332
        /**
333
         * This method associates a innerPolygon with its polygon
334
         * @param innerPolygon
335
     * Consumer application object that represents a innerPolygon 
336
         * @param Polygon
337
         * Consumer application object that represents a polygon 
338
         */
339
        public void addInnerPolygonToPolygon(Object innerPolygon, Object Polygon);
340
        
341
        /**
342
         * This method indicates that the parser has found a InnerPolygon. 
343
         * @param id
344
         * InnerPolygon identifier
345
         * @param coords
346
         * A coordinates iterator
347
         * @param srs
348
         * Spatial reference system
349
         * @return
350
         * Consumer application object that represents a innerPolygon 
351
         */
352
        public Object startInnerPolygon(String id, ICoordinateIterator coords, String srs);
353
        
354
        /**
355
         * It is thrown when the innerPolygon has been completely parsed.
356
         * @param innerPolygon
357
         * Consumer application object that represents a innerPolygon 
358
         */
359
        public void endInnerPolygon(Object innerPolygon);
360
        
361
        /**
362
         * This method indicates that the parser has found a multipoint. 
363
         * @param id
364
         * MultiPoint identifier
365
         * @param srs
366
         * Spatial reference system
367
         * @return
368
         * Consumer application object that represents a multiPoint 
369
         */
370
        public Object startMultiPoint(String id, String srs);
371
        
372
        /**
373
         * It is thrown when the multiPoint has been completely parsed
374
         * @param multiPoint
375
         * Consumer application object that represents a multiPoint
376
         */
377
        public void endMultiPoint(Object multiPoint);
378
        
379
        /**
380
         * It is thrown to add a point to one multiPoint.
381
         * @param point
382
     * Consumer application object that represents a point
383
         * @param multiPoint
384
         * Consumer application object that represents a multiPoint
385
         */
386
        public void addPointToMultiPoint(Object point,Object multiPoint);
387
        
388
        /**
389
         * This method indicates that the parser has found a multiLineString. 
390
         * @param id
391
         * MultiLineString identifier
392
         * @param srs
393
         * Spatial reference system
394
         * @return
395
         * Consumer application object that represents a multiLineString 
396
         */
397
        public Object startMultiLineString(String id, String srs);
398
        
399
        /**
400
         * It is thrown when the multiLineString has been completely parsed
401
         * @param multiLineString
402
         * Consumer application object that represents a multiLineString
403
         */
404
        public void endMultiLineString(Object multiLineString);        
405
        
406
        /**
407
         * It is thrown to add a lineString to one lineString.
408
         * @param lineString
409
     * Consumer application object that represents a lineString
410
         * @param multiLineString
411
         * Consumer application object that represents a multiLineString
412
         */
413
        public void addLineStringToMultiLineString(Object lineString,Object multiLineString);
414
        
415
        /**
416
         * This method indicates that the parser has found a multiPolygon. 
417
         * @param id
418
         * MultiPolygon identifier
419
         * @param srs
420
         * Spatial reference system
421
         * @return
422
         * Consumer application object that represents a multiPolygon 
423
         */
424
        public Object startMultiPolygon(String id, String srs);
425
        
426
        /**
427
         * It is thrown when the multiPolygon has been completely parsed
428
         * @param multiPolygon
429
         * Consumer application object that represents a multiPolygon
430
         */
431
        public void endMultiPolygon(Object multiPolygon);
432
        
433
        /**
434
         * It is thrown to add a polygon to one multiPolygon.
435
         * @param polygon
436
     * Consumer application object that represents a polygon
437
         * @param multiPolygon
438
         * Consumer application object that represents a multiPolygon
439
         */
440
        public void addPolygonToMultiPolygon(Object polygon,Object multiPolygon);
441
        
442
        /**
443
         * This method indicates that the parser has found a multiGeometry. 
444
         * @param id
445
         * MultiGeometry identifier
446
         * @param srs
447
         * Spatial reference system
448
         * @return
449
         * Consumer application object that represents a multiGeometry
450
         */
451
        public Object startMultiGeometry(String id, String srs);
452
        
453
        /**
454
         * It is thrown when the multiGeometry has been completely parsed
455
         * @param multiGeometry
456
         * Consumer application object that represents a multiGeometry
457
         */
458
        public void endMultiGeometry(Object multiGeometry);
459
        
460
        /**
461
         * It is thrown to add a geometry to one multiGeometry.
462
         * @param geometry
463
     * Consumer application object that represents a geometry
464
         * @param multiGeometry
465
         * Consumer application object that represents a multiGeometry
466
         */
467
        public void addGeometryToMultiGeometry(Object geometry,Object multiGeometry);
468
                
469
        /**
470
         * This method adds a bounding box to a feature.
471
         * @param bbox
472
         * Consumer application object that represents a bounding
473
         * box
474
         * @param feature
475
         * Consumer application object that represents a feature
476
         */
477
        public void addBboxToFeature(Object bbox, Object feature);
478
        
479
        /**
480
         * This method adds a geometry to a feature. 
481
         * @param geometry
482
         * Consumer application object that represents a geometry
483
         * @param feature
484
         * Consumer application object that represents a feature
485
         */
486
        public void addGeometryToFeature(Object geometry, Object feature);
487
}