/* * 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 javax.xml.namespace.QName; import net.opengis.wfs.OperationType; import net.opengis.wfs.WfsFactory; import org.geotools.wfs.WFS; import org.geotools.xml.AbstractSimpleBinding; import org.geotools.xml.InstanceComponent; /** * Binding object for the type http://www.opengis.net/wfs:OperationType. * * <p> * <pre> * <code> * <xsd:simpleType name="OperationType"> * <xsd:restriction base="xsd:string"> * <xsd:enumeration value="Insert"/> * <xsd:enumeration value="Update"/> * <xsd:enumeration value="Delete"/> * <xsd:enumeration value="Query"/> * <xsd:enumeration value="Lock"/> * <xsd:enumeration value="GetGmlObject"/> * </xsd:restriction> * </xsd:simpleType> * * </code> * </pre> * </p> * * @generated * * * @source $URL$ */ public class OperationTypeBinding extends AbstractSimpleBinding { public OperationTypeBinding(WfsFactory factory) { } /** * @generated */ public QName getTarget() { return WFS.OperationType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Class getType() { return OperationType.class; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(InstanceComponent instance, Object value) throws Exception { String string = (String) value; //<xsd:enumeration value="Insert"/> if (OperationType.INSERT_LITERAL.getLiteral().equals(string)) { return OperationType.INSERT_LITERAL; } //<xsd:enumeration value="Update"/> if (OperationType.UPDATE_LITERAL.getLiteral().equals(string)) { return OperationType.UPDATE_LITERAL; } //<xsd:enumeration value="Delete"/> if (OperationType.DELETE_LITERAL.getLiteral().equals(string)) { return OperationType.DELETE_LITERAL; } //<xsd:enumeration value="Query"/> if (OperationType.QUERY_LITERAL.getLiteral().equals(string)) { return OperationType.QUERY_LITERAL; } //<xsd:enumeration value="Lock"/> if (OperationType.LOCK_LITERAL.getLiteral().equals(string)) { return OperationType.LOCK_LITERAL; } //<xsd:enumeration value="GetGmlObject"/> if (OperationType.GET_GML_OBJECT_LITERAL.getLiteral().equals(string)) { return OperationType.GET_GML_OBJECT_LITERAL; } return value; } }