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.ows.OwsFactory;
08: import net.opengis.wfs.GetCapabilitiesType;
09: import net.opengis.wfs.WfsFactory;
10: import org.geotools.xml.AbstractComplexBinding;
11: import org.geotools.xml.ElementInstance;
12: import org.geotools.xml.Node;
13: import javax.xml.namespace.QName;
14:
15: /**
16: * Binding object for the type http://www.opengis.net/wfs:GetCapabilitiesType.
17: *
18: * <p>
19: * <pre>
20: * <code>
21: * <xsd:complexType name="GetCapabilitiesType"> <xsd:annotation>
22: * <xsd:documentation> This type defines the
23: * GetCapabilities operation. In response to a
24: * GetCapabilities request, a Web Feature Service must
25: * generate a capabilities XML document that validates against
26: * the schemas defined in WFS-capabilities.xsd.
27: * </xsd:documentation> </xsd:annotation>
28: * <xsd:attribute fixed="1.0.0" name="version" type="xsd:string"
29: * use="optional"/> <xsd:attribute fixed="WFS" name="service"
30: * type="xsd:string" use="required"/> </xsd:complexType>
31: *
32: * </code>
33: * </pre>
34: * </p>
35: *
36: * @generated
37: */
38: public class GetCapabilitiesTypeBinding extends AbstractComplexBinding {
39: /**
40: * Wfs factory
41: */
42: WfsFactory wfsFactory;
43:
44: /**
45: * Ows Factory
46: */
47: OwsFactory owsFactory;
48:
49: public GetCapabilitiesTypeBinding(WfsFactory wfsFactory,
50: OwsFactory owsFactory) {
51: this .wfsFactory = wfsFactory;
52: this .owsFactory = owsFactory;
53: }
54:
55: /**
56: * @generated
57: */
58: public QName getTarget() {
59: return WFS.GETCAPABILITIESTYPE;
60: }
61:
62: /**
63: * <!-- begin-user-doc -->
64: * <!-- end-user-doc -->
65: *
66: * @generated modifiable
67: */
68: public Class getType() {
69: return GetCapabilitiesType.class;
70: }
71:
72: /**
73: * <!-- begin-user-doc -->
74: * <!-- end-user-doc -->
75: *
76: * @generated modifiable
77: */
78: public Object parse(ElementInstance instance, Node node,
79: Object value) throws Exception {
80: GetCapabilitiesType getCapabilities = wfsFactory
81: .createGetCapabilitiesType();
82: getCapabilities.setAcceptVersions(owsFactory
83: .createAcceptVersionsType());
84:
85: WFSBindingUtils.service(getCapabilities, node);
86:
87: getCapabilities.getAcceptVersions().getVersion().add(
88: node.getAttributeValue("version"));
89:
90: return getCapabilities;
91: }
92: }
|