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.RollbackType;
008: import net.opengis.wfsv.WfsvFactory;
009: import org.geotools.xml.AbstractComplexBinding;
010: import org.geotools.xml.ElementInstance;
011: import org.geotools.xml.Node;
012: import org.opengis.filter.Filter;
013: import javax.xml.namespace.QName;
014:
015: /**
016: * Binding object for the type http://www.opengis.net/wfsv:RollbackType.
017: *
018: * <p>
019: * <pre>
020: * <code>
021: * <xsd:complexType name="RollbackType">
022: * <xsd:complexContent>
023: * <xsd:extension base="wfs:NativeType">
024: * <xsd:sequence>
025: * <xsd:element maxOccurs="1" minOccurs="1" ref="wfsv:DifferenceQuery">
026: * <xsd:annotation>
027: * <xsd:documentation>
028: * The difference filter will be used to compute a diff to be applied
029: * in order to perform the rollback. A rollback is conceptually just
030: * a Transaction applied on the result of a back-diff between two
031: * revisions.
032: * </xsd:documentation>
033: * </xsd:annotation>
034: * </xsd:element>
035: * </xsd:sequence>
036: * <xsd:attribute name="handle" type="xsd:string" use="optional">
037: * <xsd:annotation>
038: * <xsd:documentation>
039: * The handle attribute allows a client application
040: * to assign a client-generated request identifier
041: * to an Insert action. The handle is included to
042: * facilitate error reporting. If a Rollback action
043: * in a Transaction request fails, then a Versioning WFS may
044: * include the handle in an exception report to localize
045: * the error. If no handle is included of the offending
046: * Rollback element then a WFS may employee other means of
047: * localizing the error (e.g. line number).
048: * </xsd:documentation>
049: * </xsd:annotation>
050: * </xsd:attribute>
051: * </xsd:extension>
052: * </xsd:complexContent>
053: * </xsd:complexType>
054: *
055: * </code>
056: * </pre>
057: * </p>
058: *
059: * @generated
060: */
061: public class RollbackTypeBinding extends AbstractComplexBinding {
062: private WfsvFactory wfsvFactory;
063:
064: public RollbackTypeBinding(WfsvFactory wfsvFactory) {
065: this .wfsvFactory = wfsvFactory;
066: }
067:
068: /**
069: * @generated
070: */
071: public QName getTarget() {
072: return WFSV.RollbackType;
073: }
074:
075: /**
076: * <!-- begin-user-doc -->
077: * <!-- end-user-doc -->
078: *
079: * @generated modifiable
080: */
081: public Class getType() {
082: return RollbackType.class;
083: }
084:
085: /**
086: * <!-- begin-user-doc -->
087: * <!-- end-user-doc -->
088: *
089: * @generated modifiable
090: */
091: public Object parse(ElementInstance instance, Node node,
092: Object value) throws Exception {
093: RollbackType rollback = wfsvFactory.createRollbackType();
094:
095: if (node.hasAttribute("handle")) {
096: rollback.setHandle((String) node
097: .getAttributeValue("handle"));
098: }
099:
100: rollback.setFilter((Filter) node.getChildValue(Filter.class));
101: rollback
102: .setTypeName((QName) node.getAttributeValue("typeName"));
103: rollback.setToFeatureVersion((String) node
104: .getAttributeValue("toFeatureVersion"));
105: rollback.setVendorId((String) node
106: .getAttributeValue("vendorId"));
107: rollback.setSafeToIgnore(((Boolean) node
108: .getAttributeValue("safeToIgnore")).booleanValue());
109: rollback.setUser((String) node.getAttributeValue("user"));
110:
111: return rollback;
112: }
113: }
|