001: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
002: * This code is licensed under the GPL 2.0 license, availible at the root
003: * application directory.
004: */
005: package org.geoserver.wfs.xml.v1_1_0;
006:
007: import net.opengis.wfs.IdentifierGenerationOptionType;
008: import net.opengis.wfs.WfsFactory;
009: import org.geotools.xml.AbstractSimpleBinding;
010: import org.geotools.xml.InstanceComponent;
011: import javax.xml.namespace.QName;
012:
013: /**
014: * Binding object for the type http://www.opengis.net/wfs:IdentifierGenerationOptionType.
015: *
016: * <p>
017: * <pre>
018: * <code>
019: * <xsd:simpleType name="IdentifierGenerationOptionType">
020: * <xsd:restriction base="xsd:string">
021: * <xsd:enumeration value="UseExisting">
022: * <xsd:annotation>
023: * <xsd:documentation>
024: * The UseExsiting value indicates that WFS should not
025: * generate a new feature identifier for the feature
026: * being inserted into the repositry. Instead, the WFS
027: * should use the identifier encoded if the feature.
028: * If a duplicate exists then the WFS should raise an
029: * exception.
030: * </xsd:documentation>
031: * </xsd:annotation>
032: * </xsd:enumeration>
033: * <xsd:enumeration value="ReplaceDuplicate">
034: * <xsd:annotation>
035: * <xsd:documentation>
036: * The ReplaceDuplicate value indicates that WFS should
037: * not generate a new feature identifier for the feature
038: * being inserted into the repositry. Instead, the WFS
039: * should use the identifier encoded if the feature.
040: * If a duplicate exists then the WFS should replace the
041: * existing feature instance with the one encoded in the
042: * Insert action.
043: * </xsd:documentation>
044: * </xsd:annotation>
045: * </xsd:enumeration>
046: * <xsd:enumeration value="GenerateNew">
047: * <xsd:annotation>
048: * <xsd:documentation>
049: * The GenerateNew value indicates that WFS should
050: * generate a new unique feature identifier for the
051: * feature being inserted into the repositry.
052: * </xsd:documentation>
053: * </xsd:annotation>
054: * </xsd:enumeration>
055: * </xsd:restriction>
056: * </xsd:simpleType>
057: *
058: * </code>
059: * </pre>
060: * </p>
061: *
062: * @generated
063: */
064: public class IdentifierGenerationOptionTypeBinding extends
065: AbstractSimpleBinding {
066: WfsFactory wfsfactory;
067:
068: public IdentifierGenerationOptionTypeBinding(WfsFactory wfsfactory) {
069: this .wfsfactory = wfsfactory;
070: }
071:
072: /**
073: * @generated
074: */
075: public QName getTarget() {
076: return WFS.IDENTIFIERGENERATIONOPTIONTYPE;
077: }
078:
079: /**
080: * <!-- begin-user-doc -->
081: * <!-- end-user-doc -->
082: *
083: * @generated modifiable
084: */
085: public Class getType() {
086: return IdentifierGenerationOptionType.class;
087: }
088:
089: /**
090: * <!-- begin-user-doc -->
091: * <!-- end-user-doc -->
092: *
093: * @generated modifiable
094: */
095: public Object parse(InstanceComponent instance, Object value)
096: throws Exception {
097: if ("UseExisting".equals(value)) {
098: return IdentifierGenerationOptionType.USE_EXISTING_LITERAL;
099: }
100:
101: if ("ReplaceDuplicate".equals(value)) {
102: return IdentifierGenerationOptionType.REPLACE_DUPLICATE_LITERAL;
103: }
104:
105: if ("GenerateNew".equals(value)) {
106: return IdentifierGenerationOptionType.GENERATE_NEW_LITERAL;
107: }
108:
109: return null;
110: }
111: }
|