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_0_0;
006:
007: import net.opengis.wfs.PropertyType;
008: import net.opengis.wfs.UpdateElementType;
009: import net.opengis.wfs.WfsFactory;
010: import org.geotools.xml.AbstractComplexBinding;
011: import org.geotools.xml.ElementInstance;
012: import org.geotools.xml.Node;
013: import org.opengis.filter.Filter;
014: import javax.xml.namespace.QName;
015:
016: /**
017: * Binding object for the type http://www.opengis.net/wfs:UpdateElementType.
018: *
019: * <p>
020: * <pre>
021: * <code>
022: * <xsd:complexType name="UpdateElementType">
023: * <xsd:sequence>
024: * <xsd:element maxOccurs="unbounded" ref="wfs:Property"/>
025: * <xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter">
026: * <xsd:annotation>
027: * <xsd:documentation>
028: * The Filter element is used to constrain the scope
029: * of the update operation to those features identified
030: * by the filter. Feature instances can be specified
031: * explicitly and individually using the identifier of
032: * each feature instance OR a set of features to be
033: * operated on can be identified by specifying spatial
034: * and non-spatial constraints in the filter.
035: * If no filter is specified, then the update operation
036: * applies to all feature instances.
037: * </xsd:documentation>
038: * </xsd:annotation>
039: * </xsd:element>
040: * </xsd:sequence>
041: * <xsd:attribute name="handle" type="xsd:string" use="optional"/>
042: * <xsd:attribute name="typeName" type="xsd:QName" use="required"/>
043: * </xsd:complexType>
044: *
045: * </code>
046: * </pre>
047: * </p>
048: *
049: * @generated
050: */
051: public class UpdateElementTypeBinding extends AbstractComplexBinding {
052: WfsFactory wfsfactory;
053:
054: public UpdateElementTypeBinding(WfsFactory wfsfactory) {
055: this .wfsfactory = wfsfactory;
056: }
057:
058: /**
059: * @generated
060: */
061: public QName getTarget() {
062: return WFS.UPDATEELEMENTTYPE;
063: }
064:
065: /**
066: * <!-- begin-user-doc -->
067: * <!-- end-user-doc -->
068: *
069: * @generated modifiable
070: */
071: public Class getType() {
072: return UpdateElementType.class;
073: }
074:
075: /**
076: * <!-- begin-user-doc -->
077: * <!-- end-user-doc -->
078: *
079: * @generated modifiable
080: */
081: public Object parse(ElementInstance instance, Node node,
082: Object value) throws Exception {
083: UpdateElementType updateElement = wfsfactory
084: .createUpdateElementType();
085:
086: //<xsd:element maxOccurs="unbounded" ref="wfs:Property"/>
087: updateElement.getProperty().addAll(
088: node.getChildValues(PropertyType.class));
089:
090: //<xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter">
091: updateElement.setFilter((Filter) node
092: .getChildValue(Filter.class));
093:
094: //<xsd:attribute name="handle" type="xsd:string" use="optional"/>
095: if (node.hasAttribute("handle")) {
096: updateElement.setHandle((String) node
097: .getAttributeValue("handle"));
098: }
099:
100: //<xsd:attribute name="typeName" type="xsd:QName" use="required"/>
101: updateElement.setTypeName((QName) node
102: .getAttributeValue("typeName"));
103:
104: return updateElement;
105: }
106: }
|