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_1_0;
06:
07: import net.opengis.wfs.ResultTypeType;
08: import net.opengis.wfs.WfsFactory;
09: import org.geotools.xml.AbstractSimpleBinding;
10: import org.geotools.xml.InstanceComponent;
11: import javax.xml.namespace.QName;
12:
13: /**
14: * Binding object for the type http://www.opengis.net/wfs:ResultTypeType.
15: *
16: * <p>
17: * <pre>
18: * <code>
19: * <xsd:simpleType name="ResultTypeType">
20: * <xsd:restriction base="xsd:string">
21: * <xsd:enumeration value="results">
22: * <xsd:annotation>
23: * <xsd:documentation>
24: * Indicates that a complete response should be generated
25: * by the WFS. That is, all response feature instances
26: * should be returned to the client.
27: * </xsd:documentation>
28: * </xsd:annotation>
29: * </xsd:enumeration>
30: * <xsd:enumeration value="hits">
31: * <xsd:annotation>
32: * <xsd:documentation>
33: * Indicates that an empty response should be generated with
34: * the "numberOfFeatures" attribute set (i.e. no feature
35: * instances should be returned). In this manner a client may
36: * determine the number of feature instances that a GetFeature
37: * request will return without having to actually get the
38: * entire result set back.
39: * </xsd:documentation>
40: * </xsd:annotation>
41: * </xsd:enumeration>
42: * </xsd:restriction>
43: * </xsd:simpleType>
44: *
45: * </code>
46: * </pre>
47: * </p>
48: *
49: * @generated
50: */
51: public class ResultTypeTypeBinding extends AbstractSimpleBinding {
52: WfsFactory wfsfactory;
53:
54: public ResultTypeTypeBinding(WfsFactory wfsfactory) {
55: this .wfsfactory = wfsfactory;
56: }
57:
58: /**
59: * @generated
60: */
61: public QName getTarget() {
62: return WFS.RESULTTYPETYPE;
63: }
64:
65: /**
66: * <!-- begin-user-doc -->
67: * <!-- end-user-doc -->
68: *
69: * @generated modifiable
70: */
71: public Class getType() {
72: return ResultTypeType.class;
73: }
74:
75: /**
76: * <!-- begin-user-doc -->
77: * <!-- end-user-doc -->
78: *
79: * @generated modifiable
80: */
81: public Object parse(InstanceComponent instance, Object value)
82: throws Exception {
83: if ("results".equals(value)) {
84: return ResultTypeType.RESULTS_LITERAL;
85: }
86:
87: if ("hits".equals(value)) {
88: return ResultTypeType.HITS_LITERAL;
89: }
90:
91: return null;
92: }
93: }
|