/* (c) 2014 Open Source Geospatial Foundation - all rights reserved * (c) 2001 - 2013 OpenPlans * This code is licensed under the GPL 2.0 license, available at the root * application directory. */ package org.geoserver.wfs.xml.v1_1_0; import javax.xml.namespace.QName; import net.opengis.wfs.IdentifierGenerationOptionType; import net.opengis.wfs.WfsFactory; import org.geotools.xml.AbstractSimpleBinding; import org.geotools.xml.InstanceComponent; /** * Binding object for the type http://www.opengis.net/wfs:IdentifierGenerationOptionType. * * <p> * <pre> * <code> * <xsd:simpleType name="IdentifierGenerationOptionType"> * <xsd:restriction base="xsd:string"> * <xsd:enumeration value="UseExisting"> * <xsd:annotation> * <xsd:documentation> * The UseExsiting value indicates that WFS should not * generate a new feature identifier for the feature * being inserted into the repositry. Instead, the WFS * should use the identifier encoded if the feature. * If a duplicate exists then the WFS should raise an * exception. * </xsd:documentation> * </xsd:annotation> * </xsd:enumeration> * <xsd:enumeration value="ReplaceDuplicate"> * <xsd:annotation> * <xsd:documentation> * The ReplaceDuplicate value indicates that WFS should * not generate a new feature identifier for the feature * being inserted into the repositry. Instead, the WFS * should use the identifier encoded if the feature. * If a duplicate exists then the WFS should replace the * existing feature instance with the one encoded in the * Insert action. * </xsd:documentation> * </xsd:annotation> * </xsd:enumeration> * <xsd:enumeration value="GenerateNew"> * <xsd:annotation> * <xsd:documentation> * The GenerateNew value indicates that WFS should * generate a new unique feature identifier for the * feature being inserted into the repositry. * </xsd:documentation> * </xsd:annotation> * </xsd:enumeration> * </xsd:restriction> * </xsd:simpleType> * * </code> * </pre> * @generated */ public class IdentifierGenerationOptionTypeBinding extends AbstractSimpleBinding { WfsFactory wfsfactory; public IdentifierGenerationOptionTypeBinding(WfsFactory wfsfactory) { this.wfsfactory = wfsfactory; } /** * @generated */ public QName getTarget() { return WFS.IDENTIFIERGENERATIONOPTIONTYPE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Class getType() { return IdentifierGenerationOptionType.class; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(InstanceComponent instance, Object value) throws Exception { if ("UseExisting".equals(value)) { return IdentifierGenerationOptionType.USE_EXISTING_LITERAL; } if ("ReplaceDuplicate".equals(value)) { return IdentifierGenerationOptionType.REPLACE_DUPLICATE_LITERAL; } if ("GenerateNew".equals(value)) { return IdentifierGenerationOptionType.GENERATE_NEW_LITERAL; } return null; } }