/* 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_0_0;
import javax.xml.namespace.QName;
import net.opengis.wfs.LockType;
import net.opengis.wfs.WfsFactory;
import org.geotools.xml.AbstractComplexBinding;
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:LockType.
*
* <p>
* <pre>
* <code>
* <xsd:complexType name="LockType">
* <xsd:annotation>
* <xsd:documentation>
* This type defines the Lock element. The Lock element
* defines a locking operation on feature instances of
* a single type. An OGC Filter is used to constrain the
* scope of the operation. Features to be locked can be
* identified individually by using their feature identifier
* or they can be locked by satisfying the spatial and
* non-spatial constraints defined in the filter.
* </xsd:documentation>
* </xsd:annotation>
* <xsd:sequence>
* <xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter"/>
* </xsd:sequence>
* <xsd:attribute name="handle" type="xsd:string" use="optional"/>
* <xsd:attribute name="typeName" type="xsd:QName" use="required"/>
* </xsd:complexType>
*
* </code>
* </pre>
* </p>
*
* @generated
*/
public class LockTypeBinding extends AbstractComplexBinding {
WfsFactory wfsfactory;
public LockTypeBinding(WfsFactory wfsfactory) {
this.wfsfactory = wfsfactory;
}
/**
* @generated
*/
public QName getTarget() {
return WFS.LOCKTYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Class getType() {
return LockType.class;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value)
throws Exception {
LockType lock = wfsfactory.createLockType();
//<xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter"/>
if (node.hasChild(Filter.class)) {
lock.setFilter((Filter) node.getChildValue(Filter.class));
}
//<xsd:attribute name="handle" type="xsd:string" use="optional"/>
if (node.hasAttribute("handle")) {
lock.setHandle((String) node.getAttributeValue("handle"));
}
//<xsd:attribute name="typeName" type="xsd:QName" use="required"/>
lock.setTypeName((QName) node.getAttributeValue("typeName"));
return lock;
}
}