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 net.opengis.wfsv.DifferenceQueryType;
008: import net.opengis.wfsv.GetDiffType;
009: import net.opengis.wfsv.WfsvFactory;
010: import org.geotools.xml.AbstractComplexBinding;
011: import org.geotools.xml.ElementInstance;
012: import org.geotools.xml.Node;
013: import javax.xml.namespace.QName;
014:
015: /**
016: * Binding object for the type http://www.opengis.net/wfsv:GetDiffType.
017: *
018: * <p>
019: * <pre>
020: * <code>
021: * <xsd:complexType name="GetDiffType">
022: * <xsd:annotation>
023: * <xsd:documentation>
024: * A GetDiff element contains one or more DifferenceQuery elements
025: * that describe a difference query operation on one feature type. In
026: * response to a GetDiff request, a Versioning Web Feature Service
027: * must be able to generate a Transaction command that can be used
028: * to alter features at fromFeatureVersion and alter them into features
029: * at toFeatureVersion
030: * </xsd:documentation>
031: * </xsd:annotation>
032: * <xsd:complexContent>
033: * <xsd:extension base="wfs:BaseRequestType">
034: * <xsd:sequence>
035: * <xsd:element maxOccurs="unbounded" ref="wfsv:DifferenceQuery"/>
036: * </xsd:sequence>
037: * <xsd:attribute
038: * default="application/xml; subtype=wfsv-transaction/1.1.0"
039: * name="outputFormat" type="xsd:string" use="optional">
040: * <xsd:annotation>
041: * <xsd:documentation>
042: * The outputFormat attribute is used to specify the output
043: * format that the Versioning Web Feature Service should generate in
044: * response to a GetDiff element.
045: * The default value of 'application/xml; subtype=wfsv-transaction/1.1.0'
046: * indicates that the output is an XML document that
047: * conforms to the WFS 1.1.0 Transaction definition.
048: * For the purposes of experimentation, vendor extension,
049: * or even extensions that serve a specific community of
050: * interest, other acceptable output format values may be
051: * used to specify other formats as long as those values
052: * are advertised in the capabilities document.
053: * </xsd:documentation>
054: * </xsd:annotation>
055: * </xsd:attribute>
056: * </xsd:extension>
057: * </xsd:complexContent>
058: * </xsd:complexType>
059: *
060: * </code>
061: * </pre>
062: * </p>
063: *
064: * @generated
065: */
066: public class GetDiffTypeBinding extends AbstractComplexBinding {
067: private WfsvFactory wfsvFactory;
068:
069: public GetDiffTypeBinding(WfsvFactory wfsvFactory) {
070: this .wfsvFactory = wfsvFactory;
071: }
072:
073: /**
074: * @generated
075: */
076: public QName getTarget() {
077: return WFSV.GetDiffType;
078: }
079:
080: /**
081: * <!-- begin-user-doc -->
082: * <!-- end-user-doc -->
083: *
084: * @generated modifiable
085: */
086: public Class getType() {
087: return GetDiffType.class;
088: }
089:
090: /**
091: * <!-- begin-user-doc -->
092: * <!-- end-user-doc -->
093: *
094: * @generated modifiable
095: */
096: public Object parse(ElementInstance instance, Node node,
097: Object value) throws Exception {
098: GetDiffType result = wfsvFactory.createGetDiffType();
099: result.getDifferenceQuery().addAll(
100: node.getChildValues(DifferenceQueryType.class));
101:
102: if (node.hasAttribute("outputFormat")) {
103: result.setOutputFormat((String) node
104: .getAttributeValue("outputFormat"));
105: }
106:
107: return result;
108: }
109: }
|