/* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
* This code is licensed under the GPL 2.0 license, availible at the root
* application directory.
*/
package org.geoserver.wfs.xml.v1_1_0;
import javax.xml.namespace.QName;
import net.opengis.wfs.DeleteElementType;
import net.opengis.wfs.WfsFactory;
import org.geotools.xml.AbstractComplexEMFBinding;
import org.geotools.xml.ElementInstance;
import org.geotools.xml.Node;
import org.opengis.filter.Filter;
/**
* Binding object for the type http://www.opengis.net/wfs:DeleteElementType.
*
* <p>
* <pre>
* <code>
* <xsd:complexType name="DeleteElementType">
* <xsd:sequence>
* <xsd:element maxOccurs="1" minOccurs="1" ref="ogc:Filter">
* <xsd:annotation>
* <xsd:documentation>
* The Filter element is used to constrain the scope
* of the delete operation to those features identified
* by the filter. Feature instances can be specified
* explicitly and individually using the identifier of
* each feature instance OR a set of features to be
* operated on can be identified by specifying spatial
* and non-spatial constraints in the filter.
* If no filter is specified then an exception should
* be raised since it is unlikely that a client application
* intends to delete all feature instances.
* </xsd:documentation>
* </xsd:annotation>
* </xsd:element>
* </xsd:sequence>
* <xsd:attribute name="handle" type="xsd:string" use="optional">
* <xsd:annotation>
* <xsd:documentation>
* The handle attribute allows a client application
* to assign a client-generated request identifier
* to an Insert action. The handle is included to
* facilitate error reporting. If a Delete action
* in a Transaction request fails, then a WFS may
* include the handle in an exception report to localize
* the error. If no handle is included of the offending
* Insert element then a WFS may employee other means of
* localizing the error (e.g. line number).
* </xsd:documentation>
* </xsd:annotation>
* </xsd:attribute>
* <xsd:attribute name="typeName" type="xsd:QName" use="required">
* <xsd:annotation>
* <xsd:documentation>
* The value of the typeName attribute is the name
* of the feature type to be updated. The name
* specified must be a valid type that belongs to
* the feature content as defined by the GML
* Application Schema.
* </xsd:documentation>
* </xsd:annotation>
* </xsd:attribute>
* </xsd:complexType>
*
* </code>
* </pre>
* </p>
*
* @generated
*/
public class DeleteElementTypeBinding extends AbstractComplexEMFBinding {
WfsFactory wfsfactory;
public DeleteElementTypeBinding(WfsFactory wfsfactory) {
this.wfsfactory = wfsfactory;
}
/**
* @generated
*/
public QName getTarget() {
return WFS.DELETEELEMENTTYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Class getType() {
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value)
throws Exception {
DeleteElementType deleteElement = wfsfactory.createDeleteElementType();
//<xsd:element maxOccurs="1" minOccurs="1" ref="ogc:Filter">
deleteElement.setFilter((Filter) node.getChildValue(Filter.class));
//<xsd:attribute name="handle" type="xsd:string" use="optional"/>
if (node.hasAttribute("handle")) {
deleteElement.setHandle((String) node.getAttributeValue("handle"));
}
//<xsd:attribute name="typeName" type="xsd:QName" use="required"/>
deleteElement.setTypeName((QName) node.getAttributeValue(QName.class));
return deleteElement;
}
}