Statistics
| Revision:

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

History | View | Annotate | Download (14.6 KB)

1 10551 csanchez
package org.gvsig.gpe;
2 12219 jorpiell
/* 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$
45
* $Log$
46 12236 jorpiell
* 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 12219 jorpiell
* Add some comments and creates a warning when an operation is not supported
51
*
52
*
53
*/
54 10551 csanchez
/**
55 12219 jorpiell
 * 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 10551 csanchez
 * @author Carlos S?nchez Peri??n (sanchez_carper@gva.es)
60
 */
61
public interface IGPEContentHandler {
62 11112 jorpiell
63 11696 csanchez
        /**
64 12219 jorpiell
         * This method is thrown when the parser find a new
65
         * bounding box.
66
         * @param id
67
         * Bounding box identifier
68
         * @param x
69
         * X coordinate (minimum and maximum values)
70
         * @param y
71
         * Y coordinate (minimum and maximum values)
72
         * @param z
73
         * Z coordinate (minimum and maximum values)
74
         * @param srs
75
         * Spatial reference system
76
         * @return
77
         * The consumer application object that represents
78
         *  a bounding box
79
         */
80 11247 jorpiell
        public Object startBbox(String id, double[] x, double[] y, double[] z, String srs);
81
82 12219 jorpiell
        /**
83
         * This method indicates that the parser thas finished to
84
         * parse the bounding box.
85
         * @param bbox
86
         * The consumer application object that represents a
87
         * bounding box
88
         */
89 11247 jorpiell
        public void endBbox(Object bbox);
90
91 12219 jorpiell
        /**
92
         * It is thrown every time that a new layer is detected.
93
         * @param id
94
         * Layer identifier
95
         * @param name
96
         * Layer name
97
         * @param description
98
         * Layer description
99
         * @param srs
100
         * Layer spatial reference system
101
         * @param parentLayer
102
         * Layer that contains it
103
         * @param bBox
104
         * Layer bounding box
105
         * @param xsElementName
106
         * XML Schema element name
107
         * @return
108
         * The consumer application object that represents a layer
109
         */
110 11247 jorpiell
        public Object startLayer(String id, String name, String description,
111 12071 jorpiell
                        String srs, Object parentLayer, Object bBox, String xsElementName);
112 10551 csanchez
113 12219 jorpiell
        /**
114
         * It is thrown when a layer has been finished to parse.
115
         * @param layer
116
         * The consumer application object that represents a layer
117
         */
118 11247 jorpiell
        public void endLayer(Object layer);
119 11112 jorpiell
120 12219 jorpiell
        /**
121
         * It adds a name to one layer that has been previously
122
         * created using the startLayer method.
123
         * @param name
124
         * Layer name
125
         * @param layer
126
         * The consumer application object that represents a layer
127
         */
128 11247 jorpiell
        public void addNameToLayer(String name, Object layer);
129 11203 jorpiell
130 12219 jorpiell
        /**
131
         * It adds the description to one layer that has been previously
132
         * created using the startLayer method.
133
         * @param description
134
         * Layer description
135
         * @param layer
136
         * The consumer application object that represents a layer
137
         */
138 11247 jorpiell
        public void addDescriptionToLayer(String description, Object layer);
139 11203 jorpiell
140 12219 jorpiell
        /**
141
         * It adds a spatial reference system to one layer that
142
         * has been previously created using the startLayer method.
143
         * @param srs
144
         * Spatial reference system
145
         * @param layer
146
         * The consumer application object that represents a layer
147
         */
148 11247 jorpiell
        public void addSrsToLayer(String srs, Object Layer);
149
150 12219 jorpiell
        /**
151
         * It establish the relationship parent-child between two layers
152
         * that have been previously created using the startLayer method.
153
         * @param parent
154
         * The consumer application object that represents the parent layer
155
         * @param layer
156
         * The consumer application object that represents the child layer
157
         */
158 11247 jorpiell
        public void addParentLayerToLayer(Object parent, Object layer);
159
160 12219 jorpiell
        /**
161
         * It adds a bounding box to one layer that  has been previously
162
         * created using the startLayer method.
163
         * @param bbox
164
         * Layer bounding box
165
         * @param layer
166
         * The consumer application object that represents a layer
167
         */
168 11247 jorpiell
        public void addBboxToLayer(Object bbox, Object layer);
169
170 12219 jorpiell
        /**
171
         * It is thrown when the parser has found a new feature.
172
         * @param id
173
         * Feature identifier
174
         * @param name
175
         * Feature name
176
         * @param xsElementName
177
         * XML Schema element name
178
         * @param layer
179
         * Consumer application object that represents a layer
180
         * @return
181
         * Consumer application object that represents a feature
182
         */
183 12071 jorpiell
        public Object startFeature(String id, String name, String xsElementName, Object layer);
184 11171 jorpiell
185 12219 jorpiell
        /**
186
         * This method is thrown when the parser has finished to
187
         * parse a feature.
188
         * @param feature
189
         * Consumer application object that represents a feature
190
         */
191 11247 jorpiell
        public void endFeature(Object feature);
192 11171 jorpiell
193 12219 jorpiell
        /**
194
         * This method adds a name to one layer that has been
195
         * previously created using the startFeature method.
196
         * @param name
197
         * Feature name
198
         * @param feature
199
     * Consumer application object that represents a feature
200
         */
201 11247 jorpiell
        public void addNameToFeature(String name, Object feature);
202
203 12219 jorpiell
        /**
204
         * This method adds a feature to one layer that has been
205
         * previously created using the startLayer method.
206
         * @param feature
207
         * Consumer application object that represents a feature
208
         * @param layer
209
         * Consumer application object that represents a layer
210
         */
211 11247 jorpiell
        public void addFeatureToLayer(Object feature, Object layer);
212
213 12219 jorpiell
        /**
214
         * It is thrown when the parser has found a new element
215
         * @param name
216
         * Element name
217
         * @param value
218
         * Element value
219
         * @param xsElementName
220
         * XML Schema element name
221
         * @param parentElement
222
         * The parent of this element (if exists)
223
         * @return
224
         * Consumer application object that represents an element
225
         */
226 12071 jorpiell
        public Object startElement(String name, Object value, String xsElementName, Object parentElement);
227 11171 jorpiell
228 12219 jorpiell
        /**
229
         * This method is thrown when the parser find the end
230
         * of an element.
231
         * @param element
232
         * Consumer application object that represents an element
233
         */
234 11247 jorpiell
        public void endElement(Object element);
235 11112 jorpiell
236 12219 jorpiell
        /**
237
         * It is thrown to establish a relationship parent-child
238
         * between two elements.
239
         * @param parent
240
         * Consumer application object that represents the parent element
241
         * @param element
242
         * Consumer application object that represents the child element
243
         */
244 11247 jorpiell
        public void addParentElementToElement(Object parent, Object element);
245 11112 jorpiell
246 12219 jorpiell
        /**
247
         * This method adds an element to one feature that has been
248
         * previously created using the startFeature method
249
         * @param element
250
         * Consumer application object that represents an element
251
         * @param feature
252
         * Consumer application object that represents the feature
253
         */
254 11247 jorpiell
        public void addElementToFeature(Object element, Object feature);
255 11112 jorpiell
256 12219 jorpiell
        /**
257
         * This method indicates that the parser has found a point.
258
         * @param id
259
         * Point identifier
260
         * @param x
261
         * X coordinate
262
         * @param y
263
         * Y coordinate
264
         * @param z
265
         * Z coordinate
266
         * @param srs
267
         * Spatial reference system
268
         * @return
269
         * Consumer application object that represents a point
270
         */
271 11238 jorpiell
        public Object startPoint(String id, double x, double y, double z, String srs);
272 11112 jorpiell
273 12219 jorpiell
        /**
274
         * It is thrown when the point has been completely parsed.
275
         * @param point
276
         * Consumer application object that represents a point
277
         */
278 11247 jorpiell
        public void endPoint(Object point);
279 11112 jorpiell
280 12219 jorpiell
        /**
281
         * This method indicates that the parser has found a lineString.
282
         * @param id
283
         * LineString identifier
284
         * @param x
285
         * X coordinate (n dimensions)
286
         * @param y
287
         * Y coordinate (n dimensions)
288
         * @param z
289
         * Z coordinate (n dimensions)
290
         * @param srs
291
         * Spatial reference system
292
         * @return
293
         * Consumer application object that represents a lineString
294
         */
295 11238 jorpiell
        public Object startLineString( String id, double[] x, double[] y, double[] z, String srs);
296 11112 jorpiell
297 12219 jorpiell
        /**
298
     * It is thrown when the lineString has been completely parsed.
299
         * @param lineString
300
         * Consumer application object that represents a lineString
301
         */
302 11247 jorpiell
        public void endLineString(Object lineString);
303 11112 jorpiell
304 12219 jorpiell
        /**
305
         * This method indicates that the parser has found a linearRing.
306
         * @param id
307
         * LinearRing identifier
308
         * @param x
309
         * X coordinate (n dimensions)
310
         * @param y
311
         * Y coordinate (n dimensions)
312
         * @param z
313
         * Z coordinate (n dimensions)
314
         * @param srs
315
         * Spatial reference system
316
         * @return
317
         * Consumer application object that represents a linarRing
318
         */
319 11238 jorpiell
        public Object startLinearRing(String id, double[] x, double[] y, double[] z, String srs);
320 11112 jorpiell
321 12219 jorpiell
        /**
322
         * It is thrown when the linearRing has been completely parsed.
323
         * @param linearRing
324
         * Consumer application object that represents a linearRing
325
         */
326 11247 jorpiell
        public void endLinearRing(Object linearRing);
327 11112 jorpiell
328 12219 jorpiell
        /**
329
         * This method indicates that the parser has found a polygon.
330
         * @param id
331
         * Polygon identifier
332
         * @param x
333
         * X coordinate (n dimensions)
334
         * @param y
335
         * Y coordinate (n dimensions)
336
         * @param z
337
         * Z coordinate (n dimensions)
338
         * @param srs
339
         * Spatial reference system
340
         * @return
341
         * Consumer application object that represents a polygon
342
         */
343 11238 jorpiell
        public Object startPolygon(String id, double[] x, double[] y, double[] z, String srs);
344 11112 jorpiell
345 12219 jorpiell
        /**
346
         * It is thrown when the polygon has been completely parsed.
347
         * @param polygon
348
         * Consumer application object that represents a polygon
349
         */
350
        public void endPolygon(Object polygon);
351 11112 jorpiell
352 12219 jorpiell
        /**
353
         * This method associates a innerPolygon with its polygon
354
         * @param innerPolygon
355
     * Consumer application object that represents a innerPolygon
356
         * @param Polygon
357
         * Consumer application object that represents a polygon
358
         */
359 11247 jorpiell
        public void addInnerPolygonToPolygon(Object innerPolygon, Object Polygon);
360 11112 jorpiell
361 12219 jorpiell
        /**
362
         * This method indicates that the parser has found a InnerPolygon.
363
         * @param id
364
         * InnerPolygon identifier
365
         * @param x
366
         * X coordinate (n dimensions)
367
         * @param y
368
         * Y coordinate (n dimensions)
369
         * @param z
370
         * Z coordinate (n dimensions)
371
         * @param srs
372
         * Spatial reference system
373
         * @return
374
         * Consumer application object that represents a innerPolygon
375
         */
376 11247 jorpiell
        public Object startInnerPolygon(String id, double[] x, double[] y, double[] z, String srs);
377
378 12219 jorpiell
        /**
379
         * It is thrown when the innerPolygon has been completely parsed.
380
         * @param innerPolygon
381
         * Consumer application object that represents a innerPolygon
382
         */
383 11247 jorpiell
        public void endInnerPolygon(Object innerPolygon);
384
385 12219 jorpiell
        /**
386
         * This method indicates that the parser has found a multipoint.
387
         * @param id
388
         * MultiPoint identifier
389
         * @param srs
390
         * Spatial reference system
391
         * @return
392
         * Consumer application object that represents a multiPoint
393
         */
394 11516 jorpiell
        public Object startMultiPoint(String id, String srs);
395 11475 jorpiell
396 12219 jorpiell
        /**
397
         * It is thrown when the multiPoint has been completely parsed
398
         * @param multiPoint
399
         * Consumer application object that represents a multiPoint
400
         */
401 11475 jorpiell
        public void endMultiPoint(Object multiPoint);
402
403 12219 jorpiell
        /**
404
         * It is thrown to add a point to one multiPoint.
405
         * @param point
406
     * Consumer application object that represents a point
407
         * @param multiPoint
408
         * Consumer application object that represents a multiPoint
409
         */
410 11475 jorpiell
        public void addPointToMultiPoint(Object point,Object multiPoint);
411
412 12219 jorpiell
        /**
413
         * This method indicates that the parser has found a multiLineString.
414
         * @param id
415
         * MultiLineString identifier
416
         * @param srs
417
         * Spatial reference system
418
         * @return
419
         * Consumer application object that represents a multiLineString
420
         */
421 11516 jorpiell
        public Object startMultiLineString(String id, String srs);
422 11475 jorpiell
423 12219 jorpiell
        /**
424
         * It is thrown when the multiLineString has been completely parsed
425
         * @param multiLineString
426
         * Consumer application object that represents a multiLineString
427
         */
428 11475 jorpiell
        public void endMultiLineString(Object multiLineString);
429
430 12219 jorpiell
        /**
431
         * It is thrown to add a lineString to one lineString.
432
         * @param lineString
433
     * Consumer application object that represents a lineString
434
         * @param multiLineString
435
         * Consumer application object that represents a multiLineString
436
         */
437 11475 jorpiell
        public void addLineStringToMultiLineString(Object lineString,Object multiLineString);
438
439 12219 jorpiell
        /**
440
         * This method indicates that the parser has found a multiPolygon.
441
         * @param id
442
         * MultiPolygon identifier
443
         * @param srs
444
         * Spatial reference system
445
         * @return
446
         * Consumer application object that represents a multiPolygon
447
         */
448 11516 jorpiell
        public Object startMultiPolygon(String id, String srs);
449 11475 jorpiell
450 12219 jorpiell
        /**
451
         * It is thrown when the multiPolygon has been completely parsed
452
         * @param multiPolygon
453
         * Consumer application object that represents a multiPolygon
454
         */
455 11475 jorpiell
        public void endMultiPolygon(Object multiPolygon);
456
457 12219 jorpiell
        /**
458
         * It is thrown to add a polygon to one multiPolygon.
459
         * @param polygon
460
     * Consumer application object that represents a polygon
461
         * @param multiPolygon
462
         * Consumer application object that represents a multiPolygon
463
         */
464 11475 jorpiell
        public void addPolygonToMultiPolygon(Object polygon,Object multiPolygon);
465
466 12219 jorpiell
        /**
467
         * This method indicates that the parser has found a multiGeometry.
468
         * @param id
469
         * MultiGeometry identifier
470
         * @param srs
471
         * Spatial reference system
472
         * @return
473
         * Consumer application object that represents a multiGeometry
474
         */
475 11516 jorpiell
        public Object startMultiGeometry(String id, String srs);
476 11475 jorpiell
477 12219 jorpiell
        /**
478
         * It is thrown when the multiGeometry has been completely parsed
479
         * @param multiGeometry
480
         * Consumer application object that represents a multiGeometry
481
         */
482 11475 jorpiell
        public void endMultiGeometry(Object multiGeometry);
483
484 12219 jorpiell
        /**
485
         * It is thrown to add a geometry to one multiGeometry.
486
         * @param geometry
487
     * Consumer application object that represents a geometry
488
         * @param multiGeometry
489
         * Consumer application object that represents a multiGeometry
490
         */
491 11475 jorpiell
        public void addGeometryToMultiGeometry(Object geometry,Object multiGeometry);
492
493 12219 jorpiell
        /**
494
         * This method adds a bounding box to a feature.
495
         * @param bbox
496
         * Consumer application object that represents a bounding
497
         * box
498
         * @param feature
499
         * Consumer application object that represents a feature
500
         */
501
        public void addBboxToFeature(Object bbox, Object feature);
502 11247 jorpiell
503 12219 jorpiell
        /**
504
         * This method adds a geometry to a feature.
505
         * @param geometry
506
         * Consumer application object that represents a geometry
507
         * @param feature
508
         * Consumer application object that represents a feature
509
         */
510 11247 jorpiell
        public void addGeometryToFeature(Object geometry, Object feature);
511 10551 csanchez
}