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.DeleteElementType;
008: import net.opengis.wfs.WfsFactory;
009: import org.eclipse.emf.ecore.EObject;
010: import org.eclipse.emf.ecore.EStructuralFeature;
011: import org.geotools.xml.AbstractComplexEMFBinding;
012: import org.geotools.xml.ElementInstance;
013: import org.geotools.xml.Node;
014: import org.opengis.filter.Filter;
015: import javax.xml.namespace.QName;
016:
017: /**
018: * Binding object for the type http://www.opengis.net/wfs:DeleteElementType.
019: *
020: * <p>
021: * <pre>
022: * <code>
023: * <xsd:complexType name="DeleteElementType">
024: * <xsd:sequence>
025: * <xsd:element maxOccurs="1" minOccurs="1" ref="ogc:Filter">
026: * <xsd:annotation>
027: * <xsd:documentation>
028: * The Filter element is used to constrain the scope
029: * of the delete 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 an exception should
036: * be raised since it is unlikely that a client application
037: * intends to delete all feature instances.
038: * </xsd:documentation>
039: * </xsd:annotation>
040: * </xsd:element>
041: * </xsd:sequence>
042: * <xsd:attribute name="handle" type="xsd:string" use="optional">
043: * <xsd:annotation>
044: * <xsd:documentation>
045: * The handle attribute allows a client application
046: * to assign a client-generated request identifier
047: * to an Insert action. The handle is included to
048: * facilitate error reporting. If a Delete action
049: * in a Transaction request fails, then a WFS may
050: * include the handle in an exception report to localize
051: * the error. If no handle is included of the offending
052: * Insert element then a WFS may employee other means of
053: * localizing the error (e.g. line number).
054: * </xsd:documentation>
055: * </xsd:annotation>
056: * </xsd:attribute>
057: * <xsd:attribute name="typeName" type="xsd:QName" use="required">
058: * <xsd:annotation>
059: * <xsd:documentation>
060: * The value of the typeName attribute is the name
061: * of the feature type to be updated. The name
062: * specified must be a valid type that belongs to
063: * the feature content as defined by the GML
064: * Application Schema.
065: * </xsd:documentation>
066: * </xsd:annotation>
067: * </xsd:attribute>
068: * </xsd:complexType>
069: *
070: * </code>
071: * </pre>
072: * </p>
073: *
074: * @generated
075: */
076: public class DeleteElementTypeBinding extends AbstractComplexEMFBinding {
077: WfsFactory wfsfactory;
078:
079: public DeleteElementTypeBinding(WfsFactory wfsfactory) {
080: this .wfsfactory = wfsfactory;
081: }
082:
083: /**
084: * @generated
085: */
086: public QName getTarget() {
087: return WFS.DELETEELEMENTTYPE;
088: }
089:
090: /**
091: * <!-- begin-user-doc -->
092: * <!-- end-user-doc -->
093: *
094: * @generated modifiable
095: */
096: public Class getType() {
097: return null;
098: }
099:
100: /**
101: * <!-- begin-user-doc -->
102: * <!-- end-user-doc -->
103: *
104: * @generated modifiable
105: */
106: public Object parse(ElementInstance instance, Node node,
107: Object value) throws Exception {
108: DeleteElementType deleteElement = wfsfactory
109: .createDeleteElementType();
110:
111: //<xsd:element maxOccurs="1" minOccurs="1" ref="ogc:Filter">
112: deleteElement.setFilter((Filter) node
113: .getChildValue(Filter.class));
114:
115: //<xsd:attribute name="handle" type="xsd:string" use="optional"/>
116: if (node.hasAttribute("handle")) {
117: deleteElement.setHandle((String) node
118: .getAttributeValue("handle"));
119: }
120:
121: //<xsd:attribute name="typeName" type="xsd:QName" use="required"/>
122: deleteElement.setTypeName((QName) node
123: .getAttributeValue(QName.class));
124:
125: return deleteElement;
126: }
127: }
|