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.AllSomeType;
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:AllSomeType.
15: *
16: * <p>
17: * <pre>
18: * <code>
19: * <xsd:simpleType name="AllSomeType">
20: * <xsd:restriction base="xsd:string">
21: * <xsd:enumeration value="ALL"/>
22: * <xsd:enumeration value="SOME"/>
23: * </xsd:restriction>
24: * </xsd:simpleType>
25: *
26: * </code>
27: * </pre>
28: * </p>
29: *
30: * @generated
31: */
32: public class AllSomeTypeBinding extends AbstractSimpleBinding {
33: WfsFactory wfsfactory;
34:
35: public AllSomeTypeBinding(WfsFactory wfsfactory) {
36: this .wfsfactory = wfsfactory;
37: }
38:
39: /**
40: * @generated
41: */
42: public QName getTarget() {
43: return WFS.ALLSOMETYPE;
44: }
45:
46: /**
47: * <!-- begin-user-doc -->
48: * <!-- end-user-doc -->
49: *
50: * @generated modifiable
51: */
52: public Class getType() {
53: return AllSomeType.class;
54: }
55:
56: /**
57: * <!-- begin-user-doc -->
58: * <!-- end-user-doc -->
59: *
60: * @generated modifiable
61: */
62: public Object parse(InstanceComponent instance, Object value)
63: throws Exception {
64: if ("ALL".equals(value)) {
65: return AllSomeType.ALL_LITERAL;
66: }
67:
68: if ("SOME".equals(value)) {
69: return AllSomeType.SOME_LITERAL;
70: }
71:
72: return null;
73: }
74: }
|