01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.geoserver.wfs.xml.v1_0_0;
06:
07: import net.opengis.wfs.LockType;
08: import net.opengis.wfs.WfsFactory;
09: import org.geotools.xml.AbstractComplexBinding;
10: import org.geotools.xml.ElementInstance;
11: import org.geotools.xml.Node;
12: import org.opengis.filter.Filter;
13: import javax.xml.namespace.QName;
14:
15: /**
16: * Binding object for the type http://www.opengis.net/wfs:LockType.
17: *
18: * <p>
19: * <pre>
20: * <code>
21: * <xsd:complexType name="LockType">
22: * <xsd:annotation>
23: * <xsd:documentation>
24: * This type defines the Lock element. The Lock element
25: * defines a locking operation on feature instances of
26: * a single type. An OGC Filter is used to constrain the
27: * scope of the operation. Features to be locked can be
28: * identified individually by using their feature identifier
29: * or they can be locked by satisfying the spatial and
30: * non-spatial constraints defined in the filter.
31: * </xsd:documentation>
32: * </xsd:annotation>
33: * <xsd:sequence>
34: * <xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter"/>
35: * </xsd:sequence>
36: * <xsd:attribute name="handle" type="xsd:string" use="optional"/>
37: * <xsd:attribute name="typeName" type="xsd:QName" use="required"/>
38: * </xsd:complexType>
39: *
40: * </code>
41: * </pre>
42: * </p>
43: *
44: * @generated
45: */
46: public class LockTypeBinding extends AbstractComplexBinding {
47: WfsFactory wfsfactory;
48:
49: public LockTypeBinding(WfsFactory wfsfactory) {
50: this .wfsfactory = wfsfactory;
51: }
52:
53: /**
54: * @generated
55: */
56: public QName getTarget() {
57: return WFS.LOCKTYPE;
58: }
59:
60: /**
61: * <!-- begin-user-doc -->
62: * <!-- end-user-doc -->
63: *
64: * @generated modifiable
65: */
66: public Class getType() {
67: return LockType.class;
68: }
69:
70: /**
71: * <!-- begin-user-doc -->
72: * <!-- end-user-doc -->
73: *
74: * @generated modifiable
75: */
76: public Object parse(ElementInstance instance, Node node,
77: Object value) throws Exception {
78: LockType lock = wfsfactory.createLockType();
79:
80: //<xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter"/>
81: if (node.hasChild(Filter.class)) {
82: lock.setFilter((Filter) node.getChildValue(Filter.class));
83: }
84:
85: //<xsd:attribute name="handle" type="xsd:string" use="optional"/>
86: if (node.hasAttribute("handle")) {
87: lock.setHandle((String) node.getAttributeValue("handle"));
88: }
89:
90: //<xsd:attribute name="typeName" type="xsd:QName" use="required"/>
91: lock.setTypeName((QName) node.getAttributeValue("typeName"));
92:
93: return lock;
94: }
95: }
|