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.ows.xml.v1_0;
006:
007: import net.opengis.ows.AcceptFormatsType;
008: import net.opengis.ows.AcceptVersionsType;
009: import net.opengis.ows.GetCapabilitiesType;
010: import net.opengis.ows.OwsFactory;
011: import net.opengis.ows.SectionsType;
012: import org.geotools.xml.AbstractComplexBinding;
013: import org.geotools.xml.Binding;
014: import org.geotools.xml.ElementInstance;
015: import org.geotools.xml.Node;
016: import javax.xml.namespace.QName;
017:
018: /**
019: * Binding object for the type http://www.opengis.net/ows:GetCapabilitiesType.
020: *
021: * <p>
022: * <pre>
023: * <code>
024: * <complexType name="GetCapabilitiesType">
025: * <annotation>
026: * <documentation>XML encoded GetCapabilities operation request. This operation allows clients to retrieve service metadata about a specific service instance. In this XML encoding, no "request" parameter is included, since the element name specifies the specific operation. This base type shall be extended by each specific OWS to include the additional required "service" attribute, with the correct value for that OWS. </documentation>
027: * </annotation>
028: * <sequence>
029: * <element minOccurs="0" name="AcceptVersions" type="ows:AcceptVersionsType">
030: * <annotation>
031: * <documentation>When omitted, server shall return latest supported version. </documentation>
032: * </annotation>
033: * </element>
034: * <element minOccurs="0" name="Sections" type="ows:SectionsType">
035: * <annotation>
036: * <documentation>When omitted or not supported by server, server shall return complete service metadata (Capabilities) document. </documentation>
037: * </annotation>
038: * </element>
039: * <element minOccurs="0" name="AcceptFormats" type="ows:AcceptFormatsType">
040: * <annotation>
041: * <documentation>When omitted or not supported by server, server shall return service metadata document using the MIME type "text/xml". </documentation>
042: * </annotation>
043: * </element>
044: * </sequence>
045: * <attribute name="updateSequence" type="ows:UpdateSequenceType" use="optional">
046: * <annotation>
047: * <documentation>When omitted or not supported by server, server shall return latest complete service metadata document. </documentation>
048: * </annotation>
049: * </attribute>
050: * </complexType>
051: *
052: * </code>
053: * </pre>
054: * </p>
055: *
056: * @generated
057: */
058: public class GetCapabilitiesTypeBinding extends AbstractComplexBinding {
059: OwsFactory owsfactory;
060:
061: public GetCapabilitiesTypeBinding(OwsFactory owsfactory) {
062: this .owsfactory = owsfactory;
063: }
064:
065: /**
066: * @generated
067: */
068: public QName getTarget() {
069: return OWS.GETCAPABILITIESTYPE;
070: }
071:
072: /**
073: * <!-- begin-user-doc -->
074: * <!-- end-user-doc -->
075: *
076: * @generated modifiable
077: */
078: public Class getType() {
079: return GetCapabilitiesType.class;
080: }
081:
082: /**
083: * <!-- begin-user-doc -->
084: * @param value an instance of {@link GetCapabilitiesType} (possibly a subclass) if
085: * a binding for a specific service's GetCapabilities request used {@link Binding#BEFORE}
086: * {@link #getExecutionMode() execution mode}, and thus relies on this binding to fill
087: * the common properties. <code>null</code> otherwise.
088: *
089: * <!-- end-user-doc -->
090: *
091: * @generated modifiable
092: */
093: public Object parse(ElementInstance instance, Node node,
094: Object value) throws Exception {
095: GetCapabilitiesType getCapabilities;
096:
097: if ((value != null) && value instanceof GetCapabilitiesType) {
098: getCapabilities = (GetCapabilitiesType) value;
099: } else {
100: getCapabilities = owsfactory.createGetCapabilitiesType();
101: }
102:
103: getCapabilities.setAcceptVersions((AcceptVersionsType) node
104: .getChildValue(AcceptVersionsType.class));
105: getCapabilities.setSections((SectionsType) node
106: .getChildValue(SectionsType.class));
107: getCapabilities.setAcceptFormats((AcceptFormatsType) node
108: .getChildValue(AcceptFormatsType.class));
109: getCapabilities.setUpdateSequence((String) node
110: .getAttributeValue("updateSequence"));
111:
112: return getCapabilities;
113: }
114: }
|