001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: GetDiffTypeImpl.java 7988 2007-12-12 20:29:15Z aaime $
006: */package net.opengis.wfsv.impl;
007:
008: import java.util.Collection;
009:
010: import net.opengis.wfs.impl.BaseRequestTypeImpl;
011:
012: import net.opengis.wfsv.DifferenceQueryType;
013: import net.opengis.wfsv.GetDiffType;
014: import net.opengis.wfsv.WfsvPackage;
015:
016: import org.eclipse.emf.common.notify.Notification;
017: import org.eclipse.emf.common.notify.NotificationChain;
018:
019: import org.eclipse.emf.common.util.EList;
020:
021: import org.eclipse.emf.ecore.EClass;
022: import org.eclipse.emf.ecore.InternalEObject;
023:
024: import org.eclipse.emf.ecore.impl.ENotificationImpl;
025:
026: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
027: import org.eclipse.emf.ecore.util.InternalEList;
028:
029: /**
030: * <!-- begin-user-doc -->
031: * An implementation of the model object '<em><b>Get Diff Type</b></em>'.
032: * <!-- end-user-doc -->
033: * <p>
034: * The following features are implemented:
035: * <ul>
036: * <li>{@link net.opengis.wfsv.impl.GetDiffTypeImpl#getDifferenceQuery <em>Difference Query</em>}</li>
037: * <li>{@link net.opengis.wfsv.impl.GetDiffTypeImpl#getOutputFormat <em>Output Format</em>}</li>
038: * </ul>
039: * </p>
040: *
041: * @generated
042: */
043: public class GetDiffTypeImpl extends BaseRequestTypeImpl implements
044: GetDiffType {
045: /**
046: * The cached value of the '{@link #getDifferenceQuery() <em>Difference Query</em>}' containment reference list.
047: * <!-- begin-user-doc -->
048: * <!-- end-user-doc -->
049: * @see #getDifferenceQuery()
050: * @generated
051: * @ordered
052: */
053: protected EList differenceQuery;
054:
055: /**
056: * The default value of the '{@link #getOutputFormat() <em>Output Format</em>}' attribute.
057: * <!-- begin-user-doc -->
058: * <!-- end-user-doc -->
059: * @see #getOutputFormat()
060: * @generated
061: * @ordered
062: */
063: protected static final String OUTPUT_FORMAT_EDEFAULT = "text/xml; subtype=wfs-transaction/1.1.0";
064:
065: /**
066: * The cached value of the '{@link #getOutputFormat() <em>Output Format</em>}' attribute.
067: * <!-- begin-user-doc -->
068: * <!-- end-user-doc -->
069: * @see #getOutputFormat()
070: * @generated
071: * @ordered
072: */
073: protected String outputFormat = OUTPUT_FORMAT_EDEFAULT;
074:
075: /**
076: * This is true if the Output Format attribute has been set.
077: * <!-- begin-user-doc -->
078: * <!-- end-user-doc -->
079: * @generated
080: * @ordered
081: */
082: protected boolean outputFormatESet;
083:
084: /**
085: * <!-- begin-user-doc -->
086: * <!-- end-user-doc -->
087: * @generated
088: */
089: protected GetDiffTypeImpl() {
090: super ();
091: }
092:
093: /**
094: * <!-- begin-user-doc -->
095: * <!-- end-user-doc -->
096: * @generated
097: */
098: protected EClass eStaticClass() {
099: return WfsvPackage.Literals.GET_DIFF_TYPE;
100: }
101:
102: /**
103: * <!-- begin-user-doc -->
104: * <!-- end-user-doc -->
105: * @generated
106: */
107: public EList getDifferenceQuery() {
108: if (differenceQuery == null) {
109: differenceQuery = new EObjectContainmentEList(
110: DifferenceQueryType.class, this ,
111: WfsvPackage.GET_DIFF_TYPE__DIFFERENCE_QUERY);
112: }
113: return differenceQuery;
114: }
115:
116: /**
117: * <!-- begin-user-doc -->
118: * <!-- end-user-doc -->
119: * @generated
120: */
121: public String getOutputFormat() {
122: return outputFormat;
123: }
124:
125: /**
126: * <!-- begin-user-doc -->
127: * <!-- end-user-doc -->
128: * @generated
129: */
130: public void setOutputFormat(String newOutputFormat) {
131: String oldOutputFormat = outputFormat;
132: outputFormat = newOutputFormat;
133: boolean oldOutputFormatESet = outputFormatESet;
134: outputFormatESet = true;
135: if (eNotificationRequired())
136: eNotify(new ENotificationImpl(this , Notification.SET,
137: WfsvPackage.GET_DIFF_TYPE__OUTPUT_FORMAT,
138: oldOutputFormat, outputFormat, !oldOutputFormatESet));
139: }
140:
141: /**
142: * <!-- begin-user-doc -->
143: * <!-- end-user-doc -->
144: * @generated
145: */
146: public void unsetOutputFormat() {
147: String oldOutputFormat = outputFormat;
148: boolean oldOutputFormatESet = outputFormatESet;
149: outputFormat = OUTPUT_FORMAT_EDEFAULT;
150: outputFormatESet = false;
151: if (eNotificationRequired())
152: eNotify(new ENotificationImpl(this , Notification.UNSET,
153: WfsvPackage.GET_DIFF_TYPE__OUTPUT_FORMAT,
154: oldOutputFormat, OUTPUT_FORMAT_EDEFAULT,
155: oldOutputFormatESet));
156: }
157:
158: /**
159: * <!-- begin-user-doc -->
160: * <!-- end-user-doc -->
161: * @generated
162: */
163: public boolean isSetOutputFormat() {
164: return outputFormatESet;
165: }
166:
167: /**
168: * <!-- begin-user-doc -->
169: * <!-- end-user-doc -->
170: * @generated
171: */
172: public NotificationChain eInverseRemove(InternalEObject otherEnd,
173: int featureID, NotificationChain msgs) {
174: switch (featureID) {
175: case WfsvPackage.GET_DIFF_TYPE__DIFFERENCE_QUERY:
176: return ((InternalEList) getDifferenceQuery()).basicRemove(
177: otherEnd, msgs);
178: }
179: return super .eInverseRemove(otherEnd, featureID, msgs);
180: }
181:
182: /**
183: * <!-- begin-user-doc -->
184: * <!-- end-user-doc -->
185: * @generated
186: */
187: public Object eGet(int featureID, boolean resolve, boolean coreType) {
188: switch (featureID) {
189: case WfsvPackage.GET_DIFF_TYPE__DIFFERENCE_QUERY:
190: return getDifferenceQuery();
191: case WfsvPackage.GET_DIFF_TYPE__OUTPUT_FORMAT:
192: return getOutputFormat();
193: }
194: return super .eGet(featureID, resolve, coreType);
195: }
196:
197: /**
198: * <!-- begin-user-doc -->
199: * <!-- end-user-doc -->
200: * @generated
201: */
202: public void eSet(int featureID, Object newValue) {
203: switch (featureID) {
204: case WfsvPackage.GET_DIFF_TYPE__DIFFERENCE_QUERY:
205: getDifferenceQuery().clear();
206: getDifferenceQuery().addAll((Collection) newValue);
207: return;
208: case WfsvPackage.GET_DIFF_TYPE__OUTPUT_FORMAT:
209: setOutputFormat((String) newValue);
210: return;
211: }
212: super .eSet(featureID, newValue);
213: }
214:
215: /**
216: * <!-- begin-user-doc -->
217: * <!-- end-user-doc -->
218: * @generated
219: */
220: public void eUnset(int featureID) {
221: switch (featureID) {
222: case WfsvPackage.GET_DIFF_TYPE__DIFFERENCE_QUERY:
223: getDifferenceQuery().clear();
224: return;
225: case WfsvPackage.GET_DIFF_TYPE__OUTPUT_FORMAT:
226: unsetOutputFormat();
227: return;
228: }
229: super .eUnset(featureID);
230: }
231:
232: /**
233: * <!-- begin-user-doc -->
234: * <!-- end-user-doc -->
235: * @generated
236: */
237: public boolean eIsSet(int featureID) {
238: switch (featureID) {
239: case WfsvPackage.GET_DIFF_TYPE__DIFFERENCE_QUERY:
240: return differenceQuery != null
241: && !differenceQuery.isEmpty();
242: case WfsvPackage.GET_DIFF_TYPE__OUTPUT_FORMAT:
243: return isSetOutputFormat();
244: }
245: return super .eIsSet(featureID);
246: }
247:
248: /**
249: * <!-- begin-user-doc -->
250: * <!-- end-user-doc -->
251: * @generated
252: */
253: public String toString() {
254: if (eIsProxy())
255: return super .toString();
256:
257: StringBuffer result = new StringBuffer(super .toString());
258: result.append(" (outputFormat: ");
259: if (outputFormatESet)
260: result.append(outputFormat);
261: else
262: result.append("<unset>");
263: result.append(')');
264: return result.toString();
265: }
266:
267: } //GetDiffTypeImpl
|