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.DescribeFeatureTypeType;
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:DescribeFeatureTypeType.
016: *
017: * <p>
018: * <pre>
019: * <code>
020: * <xsd:complexType name="DescribeFeatureTypeType">
021: * <xsd:annotation>
022: * <xsd:documentation>
023: * The DescribeFeatureType operation allows a client application
024: * to request that a Web Feature Service describe one or more
025: * feature types. A Web Feature Service must be able to generate
026: * feature descriptions as valid GML3 application schemas.
027: *
028: * The schemas generated by the DescribeFeatureType operation can
029: * be used by a client application to validate the output.
030: *
031: * Feature instances within the WFS interface must be specified
032: * using GML3. The schema of feature instances specified within
033: * the WFS interface must validate against the feature schemas
034: * generated by the DescribeFeatureType request.
035: * </xsd:documentation>
036: * </xsd:annotation>
037: * <xsd:complexContent>
038: * <xsd:extension base="wfs:BaseRequestType">
039: * <xsd:sequence>
040: * <xsd:element maxOccurs="unbounded" minOccurs="0"
041: * name="TypeName" type="xsd:QName">
042: * <xsd:annotation>
043: * <xsd:documentation>
044: * The TypeName element is used to enumerate the
045: * feature types to be described. If no TypeName
046: * elements are specified then all features should
047: * be described. The name must be a valid type
048: * that belongs to the feature content as defined
049: * by the GML Application Schema.
050: * </xsd:documentation>
051: * </xsd:annotation>
052: * </xsd:element>
053: * </xsd:sequence>
054: * <xsd:attribute default="text/xml; subtype=gml/3.1.1"
055: * name="outputFormat" type="xsd:string" use="optional">
056: * <xsd:annotation>
057: * <xsd:documentation>
058: * The outputFormat attribute is used to specify what schema
059: * description language should be used to describe features.
060: * The default value of 'text/xml; subtype=3.1.1' means that
061: * the WFS must generate a GML3 application schema that can
062: * be used to validate the GML3 output of a GetFeature
063: * request or feature instances specified in Transaction
064: * operations.
065: * For the purposes of experimentation, vendor extension,
066: * or even extensions that serve a specific community of
067: * interest, other acceptable output format values may be
068: * advertised by a WFS service in the capabilities document.
069: * The meaning of such values in not defined in the WFS
070: * specification. The only proviso is such cases is that
071: * clients may safely ignore outputFormat values that do
072: * not recognize.
073: * </xsd:documentation>
074: * </xsd:annotation>
075: * </xsd:attribute>
076: * </xsd:extension>
077: * </xsd:complexContent>
078: * </xsd:complexType>
079: *
080: * </code>
081: * </pre>
082: * </p>
083: *
084: * @generated
085: */
086: public class DescribeFeatureTypeTypeBinding extends
087: AbstractComplexBinding {
088: WfsFactory wfsfactory;
089:
090: public DescribeFeatureTypeTypeBinding(WfsFactory wfsfactory) {
091: this .wfsfactory = wfsfactory;
092: }
093:
094: /**
095: * @generated
096: */
097: public QName getTarget() {
098: return WFS.DESCRIBEFEATURETYPETYPE;
099: }
100:
101: public int getExecutionMode() {
102: return BEFORE;
103: }
104:
105: /**
106: * <!-- begin-user-doc -->
107: * <!-- end-user-doc -->
108: *
109: * @generated modifiable
110: */
111: public Class getType() {
112: return DescribeFeatureTypeType.class;
113: }
114:
115: /**
116: * <!-- begin-user-doc -->
117: * <!-- end-user-doc -->
118: *
119: * @generated modifiable
120: */
121: public Object parse(ElementInstance instance, Node node,
122: Object value) throws Exception {
123: DescribeFeatureTypeType describeFeatureType = wfsfactory
124: .createDescribeFeatureTypeType();
125:
126: //<xsd:element maxOccurs="unbounded" minOccurs="0"
127: // name="TypeName" type="xsd:QName">
128: describeFeatureType.getTypeName().addAll(
129: node.getChildValues(QName.class));
130:
131: //lt;xsd:attribute default="text/xml; subtype=gml/3.1.1"
132: // name="outputFormat" type="xsd:string" use="optional">
133: if (node.hasAttribute("outputFormat")) {
134: describeFeatureType.setOutputFormat((String) node
135: .getAttributeValue("outputFormat"));
136: }
137:
138: return describeFeatureType;
139: }
140: }
|