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.WfsFactory;
08: import org.geotools.xml.AbstractSimpleBinding;
09: import org.geotools.xml.InstanceComponent;
10: import org.geotools.xs.bindings.XSQNameBinding;
11: import java.util.ArrayList;
12: import java.util.List;
13: import javax.xml.namespace.NamespaceContext;
14: import javax.xml.namespace.QName;
15:
16: /**
17: * Binding object for the type http://www.opengis.net/wfs:TypeNameListType.
18: *
19: * <p>
20: * <pre>
21: * <code>
22: * <xsd:simpleType name="TypeNameListType">
23: * <xsd:restriction base="wfs:Base_TypeNameListType">
24: * <xsd:pattern value="((\w:)?\w(=\w)?){1,}">
25: * <xsd:annotation>
26: * <xsd:documentation>
27: * Example typeName attribute value might be:
28: *
29: * typeName="ns1:Inwatera_1m=A, ns2:CoastL_1M=B"
30: *
31: * In this example, A is an alias for ns1:Inwatera_1m
32: * and B is an alias for ns2:CoastL_1M.
33: * </xsd:documentation>
34: * </xsd:annotation>
35: * </xsd:pattern>
36: * </xsd:restriction>
37: * </xsd:simpleType>
38: *
39: * </code>
40: * </pre>
41: * </p>
42: *
43: * @generated
44: */
45: public class TypeNameListTypeBinding extends AbstractSimpleBinding {
46: WfsFactory wfsfactory;
47: NamespaceContext namespaceContext;
48:
49: public TypeNameListTypeBinding(WfsFactory wfsfactory,
50: NamespaceContext namespaceContext) {
51: this .wfsfactory = wfsfactory;
52: this .namespaceContext = namespaceContext;
53: }
54:
55: /**
56: * @generated
57: */
58: public QName getTarget() {
59: return WFS.TYPENAMELISTTYPE;
60: }
61:
62: /**
63: * <!-- begin-user-doc -->
64: * <!-- end-user-doc -->
65: *
66: * @generated modifiable
67: */
68: public Class getType() {
69: return List.class;
70: }
71:
72: /**
73: * <!-- begin-user-doc -->
74: * <!-- end-user-doc -->
75: *
76: * @generated modifiable
77: */
78: public Object parse(InstanceComponent instance, Object value)
79: throws Exception {
80: //TODO: implement list support in parser so that passed in value is a list
81: //<xsd:pattern value="((\w:)?\w(=\w)?){1,}">
82:
83: //GR: List support in parser implemented, casting to List directly
84: List qNames = (List) value;
85:
86: return qNames;
87: }
88: }
|