01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library 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 GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.gml;
17:
18: import org.geotools.feature.Feature;
19: import org.geotools.feature.FeatureCollection;
20: import org.xml.sax.helpers.XMLFilterImpl;
21:
22: /**
23: * DOCUMENT ME!
24: *
25: * @author Darren Edmonds
26: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/gml/GMLReceiver.java $
27: */
28: public class GMLReceiver extends XMLFilterImpl implements
29: GMLHandlerFeature {
30: /** */
31: private FeatureCollection featureCollection;
32:
33: /**
34: * Creates a new instance of GMLReceiver
35: *
36: * @param featureCollection sets the FeatureCollection
37: */
38: public GMLReceiver(FeatureCollection featureCollection) {
39: this .featureCollection = featureCollection;
40: }
41:
42: /**
43: * Receives an OGC feature and adds it into the collection
44: *
45: * @param feature the OGC feature
46: */
47: public void feature(Feature feature) {
48: featureCollection.add(feature);
49: }
50: }
|