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.wfsv.xml.v1_1_0;
006:
007: import javax.xml.namespace.QName;
008:
009: import net.opengis.wfsv.DescribeVersionedFeatureTypeType;
010: import net.opengis.wfsv.WfsvFactory;
011:
012: import org.geoserver.wfs.xml.v1_0_0.WFSBindingUtils;
013: import org.geotools.xml.AbstractComplexBinding;
014: import org.geotools.xml.ElementInstance;
015: import org.geotools.xml.Node;
016:
017: /**
018: * Binding object for the type
019: * http://www.opengis.net/wfsv:DescribeFeatureTypeType.
020: *
021: * <p>
022: *
023: * <pre>
024: * <code>
025: * <xsd:complexType name="DescribeFeatureTypeType">
026: * <xsd:annotation>
027: * <xsd:documentation>
028: * Same as wfs:DescribeFeatureType, but with the option to output
029: * a versioned feature type instead of a plain one
030: * </xsd:documentation>
031: * </xsd:annotation>
032: * <xsd:complexContent>
033: * <xsd:extension base="wfs:DescribeFeatureTypeType">
034: * <xsd:attribute default="true" name="versioned"
035: * type="xsd:boolean" use="optional">
036: * <xsd:annotation>
037: * <xsd:documentation>
038: * If false, the output is the same as wfs:DescribeFeatureType,
039: * if true on the contrary the generated feature type will descend
040: * form wfsv:AbstractVersionedFeatureType
041: * </xsd:documentation>
042: * </xsd:annotation>
043: * </xsd:attribute>
044: * </xsd:extension>
045: * </xsd:complexContent>
046: * </xsd:complexType>
047: *
048: * </code>
049: * </pre>
050: *
051: * </p>
052: *
053: * @generated
054: */
055: public class DescribeVersionedFeatureTypeTypeBinding extends
056: AbstractComplexBinding {
057:
058: private WfsvFactory wfsvFactory;
059:
060: public DescribeVersionedFeatureTypeTypeBinding(
061: WfsvFactory wfsvFactory) {
062: this .wfsvFactory = wfsvFactory;
063: }
064:
065: /**
066: * @generated
067: */
068: public QName getTarget() {
069: return WFSV.DescribeVersionedFeatureTypeType;
070: }
071:
072: /**
073: * <!-- begin-user-doc --> <!-- end-user-doc -->
074: *
075: * @generated modifiable
076: */
077: public Class getType() {
078: return DescribeVersionedFeatureTypeType.class;
079: }
080:
081: /**
082: * <!-- begin-user-doc --> <!-- end-user-doc -->
083: *
084: * @generated modifiable
085: */
086: public Object parse(ElementInstance instance, Node node,
087: Object value) throws Exception {
088: DescribeVersionedFeatureTypeType describeFeatureType = wfsvFactory
089: .createDescribeVersionedFeatureTypeType();
090:
091: WFSBindingUtils.service(describeFeatureType, node);
092: WFSBindingUtils.version(describeFeatureType, node);
093: WFSBindingUtils.outputFormat(describeFeatureType, node,
094: "XMLSCHEMA");
095: // crude hack to work around the fact we don't have a real wfsv-1.0 configuration...
096: // we assume everybody will want only the XMLSCHEMA output format for 1.0.0...
097: if ("1.0.0".equals(describeFeatureType.getVersion()))
098: describeFeatureType.setOutputFormat("XMLSCHEMA");
099:
100: describeFeatureType.getTypeName().addAll(
101: node.getChildValues(QName.class));
102: if (node.hasAttribute("versioned"))
103: describeFeatureType.setVersioned(((Boolean) node
104: .getAttributeValue("versioned")).booleanValue());
105:
106: return describeFeatureType;
107: }
108:
109: }
|