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.wfsv.xml.v1_1_0;
006:
007: import net.opengis.wfs.PropertyType;
008: import net.opengis.wfs.UpdateElementType;
009: import net.opengis.wfsv.VersionedUpdateElementType;
010: import net.opengis.wfsv.WfsvFactory;
011: import org.geotools.xml.*;
012: import org.opengis.filter.Filter;
013: import java.net.URI;
014: import javax.xml.namespace.QName;
015:
016: /**
017: * Binding object for the type http://www.opengis.net/wfsv:VersionedUpdateElementType.
018: *
019: * <p>
020: * <pre>
021: * <code>
022: * <xsd:complexType name="VersionedUpdateElementType">
023: * <xsd:complexContent>
024: * <xsd:extension base="wfs:UpdateElementType">
025: * <xsd:attribute name="featureVersion" type="xsd:string" use="required">
026: * <xsd:annotation>
027: * <xsd:documentation>
028: * The syntax and semantics is the same as featureVersion in Query. If specified,
029: * update will check that every updated feature is still at the specified version before
030: * executing, and will fail if a change occurred on the server in the meantime.
031: * </xsd:documentation>
032: * </xsd:annotation>
033: * </xsd:attribute>
034: * </xsd:extension>
035: * </xsd:complexContent>
036: * </xsd:complexType>
037: *
038: * </code>
039: * </pre>
040: * </p>
041: *
042: * @generated
043: */
044: public class VersionedUpdateElementTypeBinding extends
045: AbstractComplexBinding {
046: private WfsvFactory wfsvFactory;
047:
048: public VersionedUpdateElementTypeBinding(WfsvFactory wfsvFactory) {
049: this .wfsvFactory = wfsvFactory;
050: }
051:
052: /**
053: * @generated
054: */
055: public QName getTarget() {
056: return WFSV.VersionedUpdateElementType;
057: }
058:
059: /**
060: * <!-- begin-user-doc -->
061: * <!-- end-user-doc -->
062: *
063: * @generated modifiable
064: */
065: public Class getType() {
066: return VersionedUpdateElementType.class;
067: }
068:
069: /**
070: * <!-- begin-user-doc -->
071: * <!-- end-user-doc -->
072: *
073: * @generated modifiable
074: */
075: public Object parse(ElementInstance instance, Node node,
076: Object value) throws Exception {
077: VersionedUpdateElementType update = wfsvFactory
078: .createVersionedUpdateElementType();
079:
080: //<xsd:element maxOccurs="unbounded" ref="wfs:Property">
081: update.getProperty().addAll(
082: node.getChildValues(PropertyType.class));
083:
084: //<xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter">
085: update.setFilter((Filter) node.getChildValue(Filter.class));
086:
087: //<xsd:attribute name="handle" type="xsd:string" use="optional">
088: if (node.hasAttribute("handle")) {
089: update.setHandle((String) node.getAttributeValue("handle"));
090: }
091:
092: //<xsd:attribute name="typeName" type="xsd:QName" use="required">
093: update.setTypeName((QName) node.getAttributeValue("typeName"));
094:
095: //<xsd:attribute default="x-application/gml:3" name="inputFormat"
096: // type="xsd:string" use="optional">
097: if (node.hasAttribute("inputFormat")) {
098: update.setInputFormat((String) node
099: .getAttributeValue("inputFormat"));
100: }
101:
102: //<xsd:attribute name="srsName" type="xsd:anyURI" use="optional">
103: if (node.hasAttribute("srsName")) {
104: update.setSrsName((URI) node.getAttributeValue("srsName"));
105: }
106:
107: update.setFeatureVersion((String) node
108: .getAttributeValue("featureVersion"));
109:
110: return update;
111: }
112: }
|