/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2002-2008, Open Source Geospatial Foundation (OSGeo) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotools.wfs.bindings; import java.util.List; import javax.xml.namespace.QName; import net.opengis.wfs.FeatureCollectionType; import net.opengis.wfs.WfsFactory; import org.eclipse.emf.ecore.EObject; import org.geotools.data.simple.SimpleFeatureCollection; import org.geotools.feature.DefaultFeatureCollection; import org.geotools.feature.FeatureCollection; import org.geotools.geometry.jts.ReferencedEnvelope; import org.geotools.gml3.GML; import org.geotools.wfs.CompositeFeatureCollection; import org.geotools.wfs.WFS; import org.geotools.xml.AbstractComplexEMFBinding; import org.geotools.xml.ElementInstance; import org.geotools.xml.Node; import org.opengis.feature.simple.SimpleFeature; /** * Binding object for the type http://www.opengis.net/wfs:FeatureCollectionType. * * <p> * <pre> * <code> * <xsd:complexType name="FeatureCollectionType"> * <xsd:annotation> * <xsd:documentation> * This type defines a container for the response to a * GetFeature or GetFeatureWithLock request. If the * request is GetFeatureWithLock, the lockId attribute * must be populated. The lockId attribute can otherwise * be safely ignored. * </xsd:documentation> * </xsd:annotation> * <xsd:complexContent> * <xsd:extension base="gml:AbstractFeatureCollectionType"> * <xsd:attribute name="lockId" type="xsd:string" use="optional"> * <xsd:annotation> * <xsd:documentation> * The value of the lockId attribute is an identifier * that a Web Feature Service generates when responding * to a GetFeatureWithLock request. A client application * can use this value in subsequent operations (such as a * Transaction request) to reference the set of locked * features. * </xsd:documentation> * </xsd:annotation> * </xsd:attribute> * <xsd:attribute name="timeStamp" type="xsd:dateTime" use="optional"> * <xsd:annotation> * <xsd:documentation> * The timeStamp attribute should contain the date and time * that the response was generated. * </xsd:documentation> * </xsd:annotation> * </xsd:attribute> * <xsd:attribute name="numberOfFeatures" * type="xsd:nonNegativeInteger" use="optional"> * <xsd:annotation> * <xsd:documentation> * The numberOfFeatures attribute should contain a * count of the number of features in the response. * That is a count of all features elements dervied * from gml:AbstractFeatureType. * </xsd:documentation> * </xsd:annotation> * </xsd:attribute> * </xsd:extension> * </xsd:complexContent> * </xsd:complexType> * * </code> * </pre> * </p> * * @generated * * * * @source $URL$ */ public class FeatureCollectionTypeBinding extends AbstractComplexEMFBinding { public FeatureCollectionTypeBinding(WfsFactory factory) { super(factory); } /** * @generated */ public QName getTarget() { return WFS.FeatureCollectionType; } @Override public Object getProperty(Object object, QName name) throws Exception { FeatureCollectionType fc = (FeatureCollectionType) object; if ( !fc.getFeature().isEmpty() ) { Object val = WFSParsingUtils.FeatureCollectionType_getProperty(fc, name); if (val != null) { return val; } } return super.getProperty(object, name); } public Object parse(ElementInstance instance, Node node, Object value) throws Exception { FeatureCollectionType fct = (FeatureCollectionType) super.parse(instance, node, value); return WFSParsingUtils.FeatureCollectionType_parse(fct, instance, node); } @Override protected void setProperty(EObject eObject, String property, Object value, boolean lax) { if ("featureMembers".equalsIgnoreCase(property)) { //ignore feature, handled in parse() } else { super.setProperty(eObject, property, value, lax); } } }