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