root / org.gvsig.gpe / library / trunk / org.gvsig.gpe / org.gvsig.gpe.lib / org.gvsig.gpe.lib.api / src / main / java / org / gvsig / gpe / lib / api / parser / IGPEContentHandler.java @ 484
History | View | Annotate | Download (16.5 KB)
1 |
package org.gvsig.gpe.lib.api.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 attributes
|
100 |
* Layer attributes
|
101 |
* @param parentLayer
|
102 |
* Layer that contains it
|
103 |
* @param bBox
|
104 |
* Layer bounding box
|
105 |
* @return
|
106 |
* The consumer application object that represents a layer
|
107 |
*/
|
108 |
public Object startLayer(String id, String namespace, String name, String description, |
109 |
String srs, IAttributesIterator attributes, Object parentLayer, Object bBox); |
110 |
|
111 |
/**
|
112 |
* It is thrown when a layer has been finished to parse.
|
113 |
* @param layer
|
114 |
* The consumer application object that represents a layer
|
115 |
*/
|
116 |
public void endLayer(Object layer); |
117 |
|
118 |
/**
|
119 |
* It adds a name to one layer that has been previously
|
120 |
* created using the startLayer method.
|
121 |
* @param name
|
122 |
* Layer name
|
123 |
* @param layer
|
124 |
* The consumer application object that represents a layer
|
125 |
*/
|
126 |
public void addNameToLayer(String name, Object layer); |
127 |
|
128 |
/**
|
129 |
* It adds the description to one layer that has been previously
|
130 |
* created using the startLayer method.
|
131 |
* @param description
|
132 |
* Layer description
|
133 |
* @param layer
|
134 |
* The consumer application object that represents a layer
|
135 |
*/
|
136 |
public void addDescriptionToLayer(String description, Object layer); |
137 |
|
138 |
/**
|
139 |
* It adds a spatial reference system to one layer that
|
140 |
* has been previously created using the startLayer method.
|
141 |
* @param srs
|
142 |
* Spatial reference system
|
143 |
* @param layer
|
144 |
* The consumer application object that represents a layer
|
145 |
*/
|
146 |
public void addSrsToLayer(String srs, Object Layer); |
147 |
|
148 |
/**
|
149 |
* It establish the relationship parent-child between two layers
|
150 |
* that have been previously created using the startLayer method.
|
151 |
* @param parent
|
152 |
* The consumer application object that represents the parent layer
|
153 |
* @param layer
|
154 |
* The consumer application object that represents the child layer
|
155 |
*/
|
156 |
public void addParentLayerToLayer(Object parent, Object layer); |
157 |
|
158 |
/**
|
159 |
* It adds a bounding box to one layer that has been previously
|
160 |
* created using the startLayer method.
|
161 |
* @param bbox
|
162 |
* Layer bounding box
|
163 |
* @param layer
|
164 |
* The consumer application object that represents a layer
|
165 |
*/
|
166 |
public void addBboxToLayer(Object bbox, Object layer); |
167 |
|
168 |
/**
|
169 |
* It is thrown when the parser has found a new feature.
|
170 |
* @param id
|
171 |
* Feature identifier
|
172 |
* @param name
|
173 |
* Feature name
|
174 |
* @param namespace
|
175 |
* XML namespace
|
176 |
* @param attributes
|
177 |
* Feature attributes
|
178 |
* @param layer
|
179 |
* Consumer application object that represents a layer
|
180 |
* @return
|
181 |
* Consumer application object that represents a feature
|
182 |
*/
|
183 |
public Object startFeature(String id, String namespace, String name, IAttributesIterator attributes, Object layer); |
184 |
|
185 |
/**
|
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 |
public void endFeature(Object feature); |
192 |
|
193 |
/**
|
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 |
public void addNameToFeature(String name, Object feature); |
202 |
|
203 |
/**
|
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 |
public void addFeatureToLayer(Object feature, Object layer); |
212 |
|
213 |
/**
|
214 |
* It is thrown when the parser has found a new element
|
215 |
* @param namespace
|
216 |
* XML namespace
|
217 |
* @param name
|
218 |
* Element name
|
219 |
* @param value
|
220 |
* Element value
|
221 |
* @param attributes
|
222 |
* Element attributes
|
223 |
* @param parentElement
|
224 |
* The parent of this element (if exists)
|
225 |
* @return
|
226 |
* Consumer application object that represents an element
|
227 |
*/
|
228 |
public Object startElement(String namespace, String name, Object value, |
229 |
IAttributesIterator attributes, Object parentElement);
|
230 |
|
231 |
/**
|
232 |
* This method is thrown when the parser find the end
|
233 |
* of an element.
|
234 |
* @param element
|
235 |
* Consumer application object that represents an element
|
236 |
*/
|
237 |
public void endElement(Object element); |
238 |
|
239 |
/**
|
240 |
* It is thrown to establish a relationship parent-child
|
241 |
* between two elements.
|
242 |
* @param parent
|
243 |
* Consumer application object that represents the parent element
|
244 |
* @param element
|
245 |
* Consumer application object that represents the child element
|
246 |
*/
|
247 |
public void addParentElementToElement(Object parent, Object element); |
248 |
|
249 |
/**
|
250 |
* This method adds an element to one feature that has been
|
251 |
* previously created using the startFeature method
|
252 |
* @param element
|
253 |
* Consumer application object that represents an element
|
254 |
* @param feature
|
255 |
* Consumer application object that represents the feature
|
256 |
*/
|
257 |
public void addElementToFeature(Object element, Object feature); |
258 |
|
259 |
/**
|
260 |
* This method indicates that the parser has found a point.
|
261 |
* @param id
|
262 |
* Point identifier
|
263 |
* @param coords
|
264 |
* A coordinates iterator
|
265 |
* @param srs
|
266 |
* Spatial reference system
|
267 |
* @return
|
268 |
* Consumer application object that represents a point
|
269 |
*/
|
270 |
public Object startPoint(String id, ICoordinateIterator coords, String srs); |
271 |
|
272 |
/**
|
273 |
* It is thrown when the point has been completely parsed.
|
274 |
* @param point
|
275 |
* Consumer application object that represents a point
|
276 |
*/
|
277 |
public void endPoint(Object point); |
278 |
|
279 |
/**
|
280 |
* This method indicates that the parser has found a lineString.
|
281 |
* @param id
|
282 |
* LineString identifier
|
283 |
* @param coords
|
284 |
* A coordinates iterator
|
285 |
* @param srs
|
286 |
* Spatial reference system
|
287 |
* @return
|
288 |
* Consumer application object that represents a lineString
|
289 |
*/
|
290 |
public Object startLineString( String id, ICoordinateIterator coords, String srs); |
291 |
|
292 |
/**
|
293 |
* It is thrown when the lineString has been completely parsed.
|
294 |
* @param lineString
|
295 |
* Consumer application object that represents a lineString
|
296 |
*/
|
297 |
public void endLineString(Object lineString); |
298 |
|
299 |
/**
|
300 |
* This method indicates that the parser has found a linearRing.
|
301 |
* @param id
|
302 |
* LinearRing identifier
|
303 |
* @param coords
|
304 |
* A coordinates iterator
|
305 |
* @param srs
|
306 |
* Spatial reference system
|
307 |
* @return
|
308 |
* Consumer application object that represents a linarRing
|
309 |
*/
|
310 |
public Object startLinearRing(String id, ICoordinateIterator coords, String srs); |
311 |
|
312 |
/**
|
313 |
* It is thrown when the linearRing has been completely parsed.
|
314 |
* @param linearRing
|
315 |
* Consumer application object that represents a linearRing
|
316 |
*/
|
317 |
public void endLinearRing(Object linearRing); |
318 |
|
319 |
/**
|
320 |
* This method indicates that the parser has found a polygon.
|
321 |
* @param id
|
322 |
* Polygon identifier
|
323 |
* @param coords
|
324 |
* A coordinates iterator
|
325 |
* @param srs
|
326 |
* Spatial reference system
|
327 |
* @return
|
328 |
* Consumer application object that represents a polygon
|
329 |
*/
|
330 |
public Object startPolygon(String id, ICoordinateIterator coords, String srs); |
331 |
|
332 |
/**
|
333 |
* It is thrown when the polygon has been completely parsed.
|
334 |
* @param polygon
|
335 |
* Consumer application object that represents a polygon
|
336 |
*/
|
337 |
public void endPolygon(Object polygon); |
338 |
|
339 |
/**
|
340 |
* This method associates a innerPolygon with its polygon
|
341 |
* @param innerPolygon
|
342 |
* Consumer application object that represents a innerPolygon
|
343 |
* @param Polygon
|
344 |
* Consumer application object that represents a polygon
|
345 |
*/
|
346 |
public void addInnerPolygonToPolygon(Object innerPolygon, Object Polygon); |
347 |
|
348 |
/**
|
349 |
* This method indicates that the parser has found a InnerPolygon.
|
350 |
* @param id
|
351 |
* InnerPolygon identifier
|
352 |
* @param coords
|
353 |
* A coordinates iterator
|
354 |
* @param srs
|
355 |
* Spatial reference system
|
356 |
* @return
|
357 |
* Consumer application object that represents a innerPolygon
|
358 |
*/
|
359 |
public Object startInnerPolygon(String id, ICoordinateIterator coords, String srs); |
360 |
|
361 |
/**
|
362 |
* It is thrown when the innerPolygon has been completely parsed.
|
363 |
* @param innerPolygon
|
364 |
* Consumer application object that represents a innerPolygon
|
365 |
*/
|
366 |
public void endInnerPolygon(Object innerPolygon); |
367 |
|
368 |
/**
|
369 |
* This method indicates that the parser has found a multipoint.
|
370 |
* @param id
|
371 |
* MultiPoint identifier
|
372 |
* @param srs
|
373 |
* Spatial reference system
|
374 |
* @return
|
375 |
* Consumer application object that represents a multiPoint
|
376 |
*/
|
377 |
public Object startMultiPoint(String id, String srs); |
378 |
|
379 |
public Object startMultiPoint(String id, String srs, int dimension); |
380 |
/**
|
381 |
* It is thrown when the multiPoint has been completely parsed
|
382 |
* @param multiPoint
|
383 |
* Consumer application object that represents a multiPoint
|
384 |
*/
|
385 |
public void endMultiPoint(Object multiPoint); |
386 |
|
387 |
/**
|
388 |
* It is thrown to add a point to one multiPoint.
|
389 |
* @param point
|
390 |
* Consumer application object that represents a point
|
391 |
* @param multiPoint
|
392 |
* Consumer application object that represents a multiPoint
|
393 |
*/
|
394 |
public void addPointToMultiPoint(Object point,Object multiPoint); |
395 |
|
396 |
/**
|
397 |
* This method indicates that the parser has found a multiLineString.
|
398 |
* @param id
|
399 |
* MultiLineString identifier
|
400 |
* @param srs
|
401 |
* Spatial reference system
|
402 |
* @return
|
403 |
* Consumer application object that represents a multiLineString
|
404 |
*/
|
405 |
public Object startMultiLineString(String id, String srs); |
406 |
|
407 |
public Object startMultiLineString(String id, String srs, int dimension); |
408 |
|
409 |
/**
|
410 |
* It is thrown when the multiLineString has been completely parsed
|
411 |
* @param multiLineString
|
412 |
* Consumer application object that represents a multiLineString
|
413 |
*/
|
414 |
public void endMultiLineString(Object multiLineString); |
415 |
|
416 |
/**
|
417 |
* It is thrown to add a lineString to one lineString.
|
418 |
* @param lineString
|
419 |
* Consumer application object that represents a lineString
|
420 |
* @param multiLineString
|
421 |
* Consumer application object that represents a multiLineString
|
422 |
*/
|
423 |
public void addLineStringToMultiLineString(Object lineString,Object multiLineString); |
424 |
|
425 |
/**
|
426 |
* This method indicates that the parser has found a multiPolygon.
|
427 |
* @param id
|
428 |
* MultiPolygon identifier
|
429 |
* @param srs
|
430 |
* Spatial reference system
|
431 |
* @return
|
432 |
* Consumer application object that represents a multiPolygon
|
433 |
*/
|
434 |
public Object startMultiPolygon(String id, String srs); |
435 |
|
436 |
public Object startMultiPolygon(String id, String srs, int dimension); |
437 |
|
438 |
/**
|
439 |
* It is thrown when the multiPolygon has been completely parsed
|
440 |
* @param multiPolygon
|
441 |
* Consumer application object that represents a multiPolygon
|
442 |
*/
|
443 |
public void endMultiPolygon(Object multiPolygon); |
444 |
|
445 |
/**
|
446 |
* It is thrown to add a polygon to one multiPolygon.
|
447 |
* @param polygon
|
448 |
* Consumer application object that represents a polygon
|
449 |
* @param multiPolygon
|
450 |
* Consumer application object that represents a multiPolygon
|
451 |
*/
|
452 |
public void addPolygonToMultiPolygon(Object polygon,Object multiPolygon); |
453 |
|
454 |
/**
|
455 |
* This method indicates that the parser has found a multiGeometry.
|
456 |
* @param id
|
457 |
* MultiGeometry identifier
|
458 |
* @param srs
|
459 |
* Spatial reference system
|
460 |
* @return
|
461 |
* Consumer application object that represents a multiGeometry
|
462 |
*/
|
463 |
public Object startMultiGeometry(String id, String srs); |
464 |
|
465 |
/**
|
466 |
* It is thrown when the multiGeometry has been completely parsed
|
467 |
* @param multiGeometry
|
468 |
* Consumer application object that represents a multiGeometry
|
469 |
*/
|
470 |
public void endMultiGeometry(Object multiGeometry); |
471 |
|
472 |
/**
|
473 |
* It is thrown to add a geometry to one multiGeometry.
|
474 |
* @param geometry
|
475 |
* Consumer application object that represents a geometry
|
476 |
* @param multiGeometry
|
477 |
* Consumer application object that represents a multiGeometry
|
478 |
*/
|
479 |
public void addGeometryToMultiGeometry(Object geometry,Object multiGeometry); |
480 |
|
481 |
/**
|
482 |
* This method adds a bounding box to a feature.
|
483 |
* @param bbox
|
484 |
* Consumer application object that represents a bounding
|
485 |
* box
|
486 |
* @param feature
|
487 |
* Consumer application object that represents a feature
|
488 |
*/
|
489 |
public void addBboxToFeature(Object bbox, Object feature); |
490 |
|
491 |
/**
|
492 |
* This method adds a geometry to a feature.
|
493 |
* @param geometry
|
494 |
* Consumer application object that represents a geometry
|
495 |
* @param feature
|
496 |
* Consumer application object that represents a feature
|
497 |
*/
|
498 |
public void addGeometryToFeature(Object geometry, Object feature); |
499 |
|
500 |
/**
|
501 |
* It is thrown when the parser has found a new metadata tag
|
502 |
* @param type
|
503 |
* String with the type of metadata, if is a description or any else
|
504 |
* @param data
|
505 |
* String with the value of the data.
|
506 |
* @param attributes
|
507 |
* Object to pass the Atributtes
|
508 |
* @return
|
509 |
* Consumer application object that represents metadata
|
510 |
*/
|
511 |
public Object startMetadata(String type, String data, IAttributesIterator attributes); |
512 |
|
513 |
/**
|
514 |
* This method adds metadata to feature.
|
515 |
* @param metadata
|
516 |
* Consumer application object that represents metadata
|
517 |
* @param feature
|
518 |
* Consumer application object that represents a feature
|
519 |
*/
|
520 |
public void addMetadataToFeature(Object metadata, Object feature); |
521 |
|
522 |
/**
|
523 |
* This method adds metadata to complex metadata.
|
524 |
* @param metadata
|
525 |
* Consumer application object that represents metadata
|
526 |
* @param parent
|
527 |
* Consumer application object that represents the complex metadata
|
528 |
*/
|
529 |
public void addMetadataToMetadata(Object metadata, Object parent); |
530 |
|
531 |
/**
|
532 |
* This method is thrown when the parser find the end of the metadata
|
533 |
* of an element.
|
534 |
* @param metadata
|
535 |
* Consumer application object that represents metadata
|
536 |
*/
|
537 |
public void endMetadata(Object metadata); |
538 |
|
539 |
/**
|
540 |
* This method is thrown when the parser find the end of and element time tag
|
541 |
* @param time
|
542 |
* Consumer application object that represents time
|
543 |
*/
|
544 |
public void endTime(Object time); |
545 |
|
546 |
/**
|
547 |
* It is thrown when the parser has found a new time tag tag
|
548 |
* @param type
|
549 |
* String with the type of time, if is a description or any else
|
550 |
* @param data
|
551 |
* String with the value of the data.
|
552 |
* @return
|
553 |
* Consumer application object that represents time
|
554 |
*/
|
555 |
public Object startTime(String name, String description, String type, String time, Object previous, Object next); |
556 |
public Object startTime(String type, String time); |
557 |
|
558 |
/**
|
559 |
* This method adds time to feature.
|
560 |
* @param time
|
561 |
* Consumer application object that represents time
|
562 |
* @param feature
|
563 |
* Consumer application object that represents a feature
|
564 |
*/
|
565 |
public void addTimeToFeature(Object time, Object feature); |
566 |
} |