001: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
002: * This code is licensed under the GPL 2.0 license, availible at the root
003: * application directory.
004: */
005: package org.geoserver.wfs.xml.v1_1_0;
006:
007: import net.opengis.wfs.GetCapabilitiesType;
008: import net.opengis.wfs.WfsFactory;
009: import org.geotools.xml.AbstractComplexBinding;
010: import org.geotools.xml.ElementInstance;
011: import org.geotools.xml.Node;
012: import javax.xml.namespace.QName;
013:
014: /**
015: * Binding object for the type http://www.opengis.net/wfs:GetCapabilitiesType.
016: *
017: * <p>
018: * <pre>
019: * <code>
020: * <xsd:complexType name="GetCapabilitiesType">
021: * <xsd:annotation>
022: * <xsd:documentation>
023: * Request to a WFS to perform the GetCapabilities operation.
024: * This operation allows a client to retrieve a Capabilities
025: * XML document providing metadata for the specific WFS server.
026: *
027: * The GetCapapbilities element is used to request that a Web Feature
028: * Service generate an XML document describing the organization
029: * providing the service, the WFS operations that the service
030: * supports, a list of feature types that the service can operate
031: * on and list of filtering capabilities that the service support.
032: * Such an XML document is called a capabilities document.
033: * </xsd:documentation>
034: * </xsd:annotation>
035: * <xsd:complexContent>
036: * <xsd:extension base="ows:GetCapabilitiesType">
037: * <xsd:attribute default="WFS" name="service"
038: * type="ows:ServiceType" use="optional"/>
039: * </xsd:extension>
040: * </xsd:complexContent>
041: * </xsd:complexType>
042: *
043: * </code>
044: * </pre>
045: * </p>
046: *
047: * @generated
048: */
049: public class GetCapabilitiesTypeBinding extends AbstractComplexBinding {
050: WfsFactory wfsfactory;
051:
052: public GetCapabilitiesTypeBinding(WfsFactory wfsfactory) {
053: this .wfsfactory = wfsfactory;
054: }
055:
056: public int getExecutionMode() {
057: return AFTER;
058: }
059:
060: /**
061: * @generated
062: */
063: public QName getTarget() {
064: return WFS.GETCAPABILITIESTYPE;
065: }
066:
067: /**
068: * <!-- begin-user-doc -->
069: * <!-- end-user-doc -->
070: *
071: * @generated modifiable
072: */
073: public Class getType() {
074: return GetCapabilitiesType.class;
075: }
076:
077: /**
078: * <!-- begin-user-doc -->
079: * <!-- end-user-doc -->
080: *
081: * @generated modifiable
082: */
083: public Object parse(ElementInstance instance, Node node,
084: Object value) throws Exception {
085: net.opengis.ows.GetCapabilitiesType owsGetCapabilities = (net.opengis.ows.GetCapabilitiesType) value;
086: GetCapabilitiesType getCapabilities = wfsfactory
087: .createGetCapabilitiesType();
088:
089: getCapabilities.setAcceptFormats(owsGetCapabilities
090: .getAcceptFormats());
091: getCapabilities.setAcceptVersions(owsGetCapabilities
092: .getAcceptVersions());
093: getCapabilities.setSections(owsGetCapabilities.getSections());
094: getCapabilities.setUpdateSequence(owsGetCapabilities
095: .getUpdateSequence());
096:
097: if (node.hasAttribute("service")) {
098: getCapabilities.setService((String) node
099: .getAttributeValue("service"));
100: }
101:
102: return getCapabilities;
103: }
104: }
|