/*
* 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.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.namespace.QName;
import net.opengis.wfs.FeatureTypeType;
import net.opengis.wfs.WfsFactory;
import org.eclipse.emf.ecore.EObject;
import org.geotools.wfs.WFS;
import org.geotools.xml.AbstractComplexEMFBinding;
/**
* Binding object for the type http://www.opengis.net/wfs:FeatureTypeType.
*
* <p>
* <pre>
* <code>
* <xsd:complexType name="FeatureTypeType">
* <xsd:annotation>
* <xsd:documentation>
* An element of this type that describes a feature in an application
* namespace shall have an xml xmlns specifier, e.g.
* xmlns:bo="http://www.BlueOx.org/BlueOx"
* </xsd:documentation>
* </xsd:annotation>
* <xsd:sequence>
* <xsd:element name="Name" type="xsd:QName">
* <xsd:annotation>
* <xsd:documentation>
* Name of this feature type, including any namespace prefix
* </xsd:documentation>
* </xsd:annotation>
* </xsd:element>
* <xsd:element name="Title" type="xsd:string">
* <xsd:annotation>
* <xsd:documentation>
* Title of this feature type, normally used for display
* to a human.
* </xsd:documentation>
* </xsd:annotation>
* </xsd:element>
* <xsd:element minOccurs="0" name="Abstract" type="xsd:string">
* <xsd:annotation>
* <xsd:documentation>
* Brief narrative description of this feature type, normally
* used for display to a human.
* </xsd:documentation>
* </xsd:annotation>
* </xsd:element>
* <xsd:element maxOccurs="unbounded" minOccurs="0" ref="ows:Keywords"/>
* <xsd:choice>
* <xsd:sequence>
* <xsd:element name="DefaultSRS" type="xsd:anyURI">
* <xsd:annotation>
* <xsd:documentation>
* The DefaultSRS element indicated which spatial
* reference system shall be used by a WFS to
* express the state of a spatial feature if not
* otherwise explicitly identified within a query
* or transaction request. The SRS may be indicated
* using either the EPSG form (EPSG:posc code) or
* the URL form defined in subclause 4.3.2 of
* refernce[2].
* </xsd:documentation>
* </xsd:annotation>
* </xsd:element>
* <xsd:element maxOccurs="unbounded" minOccurs="0"
* name="OtherSRS" type="xsd:anyURI">
* <xsd:annotation>
* <xsd:documentation>
* The OtherSRS element is used to indicate other
* supported SRSs within query and transaction
* operations. A supported SRS means that the
* WFS supports the transformation of spatial
* properties between the OtherSRS and the internal
* storage SRS. The effects of such transformations
* must be considered when determining and declaring
* the guaranteed data accuracy.
* </xsd:documentation>
* </xsd:annotation>
* </xsd:element>
* </xsd:sequence>
* <xsd:element name="NoSRS">
* <xsd:complexType name="FeatureTypeType_NoSRS"/>
* </xsd:element>
* </xsd:choice>
* <xsd:element minOccurs="0" name="Operations" type="wfs:OperationsType"/>
* <xsd:element minOccurs="0" name="OutputFormats" type="wfs:OutputFormatListType"/>
* <xsd:element maxOccurs="unbounded" minOccurs="1" ref="ows:WGS84BoundingBox"/>
* <xsd:element maxOccurs="unbounded" minOccurs="0"
* name="MetadataURL" type="wfs:MetadataURLType"/>
* </xsd:sequence>
* </xsd:complexType>
*
* </code>
* </pre>
* </p>
*
* @generated
*
* @source $URL$
*/
public class FeatureTypeTypeBinding extends AbstractComplexEMFBinding {
public FeatureTypeTypeBinding(WfsFactory factory) {
super(factory);
}
/**
* @generated
*/
public QName getTarget() {
return WFS.FeatureTypeType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Class getType() {
return FeatureTypeType.class;
}
@SuppressWarnings({ "unchecked", "nls" })
@Override
protected void setProperty(EObject eObject, String property, Object value, boolean lax) {
if ("OtherSRS".equals(property)) {
if (value instanceof Collection) {
Collection<URI> formatListAsUris = (Collection<URI>) value;
List<String> formatListAsString = new ArrayList<String>();
for (URI uri : formatListAsUris) {
formatListAsString.add(uri.toString());
}
value = formatListAsString;
} else {
URI uri = (URI) value;
value = uri.toString();
}
}
super.setProperty(eObject, property, value, lax);
}
}