001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: TransactionResponseTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.wfs.impl;
007:
008: import net.opengis.wfs.InsertResultsType;
009: import net.opengis.wfs.TransactionResponseType;
010: import net.opengis.wfs.TransactionResultsType;
011: import net.opengis.wfs.TransactionSummaryType;
012: import net.opengis.wfs.WfsPackage;
013:
014: import org.eclipse.emf.common.notify.Notification;
015: import org.eclipse.emf.common.notify.NotificationChain;
016:
017: import org.eclipse.emf.ecore.EClass;
018: import org.eclipse.emf.ecore.InternalEObject;
019:
020: import org.eclipse.emf.ecore.impl.ENotificationImpl;
021: import org.eclipse.emf.ecore.impl.EObjectImpl;
022:
023: /**
024: * <!-- begin-user-doc -->
025: * An implementation of the model object '<em><b>Transaction Response Type</b></em>'.
026: * <!-- end-user-doc -->
027: * <p>
028: * The following features are implemented:
029: * <ul>
030: * <li>{@link net.opengis.wfs.impl.TransactionResponseTypeImpl#getTransactionSummary <em>Transaction Summary</em>}</li>
031: * <li>{@link net.opengis.wfs.impl.TransactionResponseTypeImpl#getTransactionResults <em>Transaction Results</em>}</li>
032: * <li>{@link net.opengis.wfs.impl.TransactionResponseTypeImpl#getInsertResults <em>Insert Results</em>}</li>
033: * <li>{@link net.opengis.wfs.impl.TransactionResponseTypeImpl#getVersion <em>Version</em>}</li>
034: * </ul>
035: * </p>
036: *
037: * @generated
038: */
039: public class TransactionResponseTypeImpl extends EObjectImpl implements
040: TransactionResponseType {
041: /**
042: * The cached value of the '{@link #getTransactionSummary() <em>Transaction Summary</em>}' containment reference.
043: * <!-- begin-user-doc -->
044: * <!-- end-user-doc -->
045: * @see #getTransactionSummary()
046: * @generated
047: * @ordered
048: */
049: protected TransactionSummaryType transactionSummary;
050:
051: /**
052: * The cached value of the '{@link #getTransactionResults() <em>Transaction Results</em>}' containment reference.
053: * <!-- begin-user-doc -->
054: * <!-- end-user-doc -->
055: * @see #getTransactionResults()
056: * @generated
057: * @ordered
058: */
059: protected TransactionResultsType transactionResults;
060:
061: /**
062: * The cached value of the '{@link #getInsertResults() <em>Insert Results</em>}' containment reference.
063: * <!-- begin-user-doc -->
064: * <!-- end-user-doc -->
065: * @see #getInsertResults()
066: * @generated
067: * @ordered
068: */
069: protected InsertResultsType insertResults;
070:
071: /**
072: * The default value of the '{@link #getVersion() <em>Version</em>}' attribute.
073: * <!-- begin-user-doc -->
074: * <!-- end-user-doc -->
075: * @see #getVersion()
076: * @generated
077: * @ordered
078: */
079: protected static final String VERSION_EDEFAULT = "1.1.0";
080:
081: /**
082: * The cached value of the '{@link #getVersion() <em>Version</em>}' attribute.
083: * <!-- begin-user-doc -->
084: * <!-- end-user-doc -->
085: * @see #getVersion()
086: * @generated
087: * @ordered
088: */
089: protected String version = VERSION_EDEFAULT;
090:
091: /**
092: * This is true if the Version attribute has been set.
093: * <!-- begin-user-doc -->
094: * <!-- end-user-doc -->
095: * @generated
096: * @ordered
097: */
098: protected boolean versionESet;
099:
100: /**
101: * <!-- begin-user-doc -->
102: * <!-- end-user-doc -->
103: * @generated
104: */
105: protected TransactionResponseTypeImpl() {
106: super ();
107: }
108:
109: /**
110: * <!-- begin-user-doc -->
111: * <!-- end-user-doc -->
112: * @generated
113: */
114: protected EClass eStaticClass() {
115: return WfsPackage.Literals.TRANSACTION_RESPONSE_TYPE;
116: }
117:
118: /**
119: * <!-- begin-user-doc -->
120: * <!-- end-user-doc -->
121: * @generated
122: */
123: public TransactionSummaryType getTransactionSummary() {
124: return transactionSummary;
125: }
126:
127: /**
128: * <!-- begin-user-doc -->
129: * <!-- end-user-doc -->
130: * @generated
131: */
132: public NotificationChain basicSetTransactionSummary(
133: TransactionSummaryType newTransactionSummary,
134: NotificationChain msgs) {
135: TransactionSummaryType oldTransactionSummary = transactionSummary;
136: transactionSummary = newTransactionSummary;
137: if (eNotificationRequired()) {
138: ENotificationImpl notification = new ENotificationImpl(
139: this ,
140: Notification.SET,
141: WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_SUMMARY,
142: oldTransactionSummary, newTransactionSummary);
143: if (msgs == null)
144: msgs = notification;
145: else
146: msgs.add(notification);
147: }
148: return msgs;
149: }
150:
151: /**
152: * <!-- begin-user-doc -->
153: * <!-- end-user-doc -->
154: * @generated
155: */
156: public void setTransactionSummary(
157: TransactionSummaryType newTransactionSummary) {
158: if (newTransactionSummary != transactionSummary) {
159: NotificationChain msgs = null;
160: if (transactionSummary != null)
161: msgs = ((InternalEObject) transactionSummary)
162: .eInverseRemove(
163: this ,
164: EOPPOSITE_FEATURE_BASE
165: - WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_SUMMARY,
166: null, msgs);
167: if (newTransactionSummary != null)
168: msgs = ((InternalEObject) newTransactionSummary)
169: .eInverseAdd(
170: this ,
171: EOPPOSITE_FEATURE_BASE
172: - WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_SUMMARY,
173: null, msgs);
174: msgs = basicSetTransactionSummary(newTransactionSummary,
175: msgs);
176: if (msgs != null)
177: msgs.dispatch();
178: } else if (eNotificationRequired())
179: eNotify(new ENotificationImpl(
180: this ,
181: Notification.SET,
182: WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_SUMMARY,
183: newTransactionSummary, newTransactionSummary));
184: }
185:
186: /**
187: * <!-- begin-user-doc -->
188: * <!-- end-user-doc -->
189: * @generated
190: */
191: public TransactionResultsType getTransactionResults() {
192: return transactionResults;
193: }
194:
195: /**
196: * <!-- begin-user-doc -->
197: * <!-- end-user-doc -->
198: * @generated
199: */
200: public NotificationChain basicSetTransactionResults(
201: TransactionResultsType newTransactionResults,
202: NotificationChain msgs) {
203: TransactionResultsType oldTransactionResults = transactionResults;
204: transactionResults = newTransactionResults;
205: if (eNotificationRequired()) {
206: ENotificationImpl notification = new ENotificationImpl(
207: this ,
208: Notification.SET,
209: WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_RESULTS,
210: oldTransactionResults, newTransactionResults);
211: if (msgs == null)
212: msgs = notification;
213: else
214: msgs.add(notification);
215: }
216: return msgs;
217: }
218:
219: /**
220: * <!-- begin-user-doc -->
221: * <!-- end-user-doc -->
222: * @generated
223: */
224: public void setTransactionResults(
225: TransactionResultsType newTransactionResults) {
226: if (newTransactionResults != transactionResults) {
227: NotificationChain msgs = null;
228: if (transactionResults != null)
229: msgs = ((InternalEObject) transactionResults)
230: .eInverseRemove(
231: this ,
232: EOPPOSITE_FEATURE_BASE
233: - WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_RESULTS,
234: null, msgs);
235: if (newTransactionResults != null)
236: msgs = ((InternalEObject) newTransactionResults)
237: .eInverseAdd(
238: this ,
239: EOPPOSITE_FEATURE_BASE
240: - WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_RESULTS,
241: null, msgs);
242: msgs = basicSetTransactionResults(newTransactionResults,
243: msgs);
244: if (msgs != null)
245: msgs.dispatch();
246: } else if (eNotificationRequired())
247: eNotify(new ENotificationImpl(
248: this ,
249: Notification.SET,
250: WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_RESULTS,
251: newTransactionResults, newTransactionResults));
252: }
253:
254: /**
255: * <!-- begin-user-doc -->
256: * <!-- end-user-doc -->
257: * @generated
258: */
259: public InsertResultsType getInsertResults() {
260: return insertResults;
261: }
262:
263: /**
264: * <!-- begin-user-doc -->
265: * <!-- end-user-doc -->
266: * @generated
267: */
268: public NotificationChain basicSetInsertResults(
269: InsertResultsType newInsertResults, NotificationChain msgs) {
270: InsertResultsType oldInsertResults = insertResults;
271: insertResults = newInsertResults;
272: if (eNotificationRequired()) {
273: ENotificationImpl notification = new ENotificationImpl(
274: this ,
275: Notification.SET,
276: WfsPackage.TRANSACTION_RESPONSE_TYPE__INSERT_RESULTS,
277: oldInsertResults, newInsertResults);
278: if (msgs == null)
279: msgs = notification;
280: else
281: msgs.add(notification);
282: }
283: return msgs;
284: }
285:
286: /**
287: * <!-- begin-user-doc -->
288: * <!-- end-user-doc -->
289: * @generated
290: */
291: public void setInsertResults(InsertResultsType newInsertResults) {
292: if (newInsertResults != insertResults) {
293: NotificationChain msgs = null;
294: if (insertResults != null)
295: msgs = ((InternalEObject) insertResults)
296: .eInverseRemove(
297: this ,
298: EOPPOSITE_FEATURE_BASE
299: - WfsPackage.TRANSACTION_RESPONSE_TYPE__INSERT_RESULTS,
300: null, msgs);
301: if (newInsertResults != null)
302: msgs = ((InternalEObject) newInsertResults)
303: .eInverseAdd(
304: this ,
305: EOPPOSITE_FEATURE_BASE
306: - WfsPackage.TRANSACTION_RESPONSE_TYPE__INSERT_RESULTS,
307: null, msgs);
308: msgs = basicSetInsertResults(newInsertResults, msgs);
309: if (msgs != null)
310: msgs.dispatch();
311: } else if (eNotificationRequired())
312: eNotify(new ENotificationImpl(
313: this ,
314: Notification.SET,
315: WfsPackage.TRANSACTION_RESPONSE_TYPE__INSERT_RESULTS,
316: newInsertResults, newInsertResults));
317: }
318:
319: /**
320: * <!-- begin-user-doc -->
321: * <!-- end-user-doc -->
322: * @generated
323: */
324: public String getVersion() {
325: return version;
326: }
327:
328: /**
329: * <!-- begin-user-doc -->
330: * <!-- end-user-doc -->
331: * @generated
332: */
333: public void setVersion(String newVersion) {
334: String oldVersion = version;
335: version = newVersion;
336: boolean oldVersionESet = versionESet;
337: versionESet = true;
338: if (eNotificationRequired())
339: eNotify(new ENotificationImpl(this , Notification.SET,
340: WfsPackage.TRANSACTION_RESPONSE_TYPE__VERSION,
341: oldVersion, version, !oldVersionESet));
342: }
343:
344: /**
345: * <!-- begin-user-doc -->
346: * <!-- end-user-doc -->
347: * @generated
348: */
349: public void unsetVersion() {
350: String oldVersion = version;
351: boolean oldVersionESet = versionESet;
352: version = VERSION_EDEFAULT;
353: versionESet = false;
354: if (eNotificationRequired())
355: eNotify(new ENotificationImpl(this , Notification.UNSET,
356: WfsPackage.TRANSACTION_RESPONSE_TYPE__VERSION,
357: oldVersion, VERSION_EDEFAULT, oldVersionESet));
358: }
359:
360: /**
361: * <!-- begin-user-doc -->
362: * <!-- end-user-doc -->
363: * @generated
364: */
365: public boolean isSetVersion() {
366: return versionESet;
367: }
368:
369: /**
370: * <!-- begin-user-doc -->
371: * <!-- end-user-doc -->
372: * @generated
373: */
374: public NotificationChain eInverseRemove(InternalEObject otherEnd,
375: int featureID, NotificationChain msgs) {
376: switch (featureID) {
377: case WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_SUMMARY:
378: return basicSetTransactionSummary(null, msgs);
379: case WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_RESULTS:
380: return basicSetTransactionResults(null, msgs);
381: case WfsPackage.TRANSACTION_RESPONSE_TYPE__INSERT_RESULTS:
382: return basicSetInsertResults(null, msgs);
383: }
384: return super .eInverseRemove(otherEnd, featureID, msgs);
385: }
386:
387: /**
388: * <!-- begin-user-doc -->
389: * <!-- end-user-doc -->
390: * @generated
391: */
392: public Object eGet(int featureID, boolean resolve, boolean coreType) {
393: switch (featureID) {
394: case WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_SUMMARY:
395: return getTransactionSummary();
396: case WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_RESULTS:
397: return getTransactionResults();
398: case WfsPackage.TRANSACTION_RESPONSE_TYPE__INSERT_RESULTS:
399: return getInsertResults();
400: case WfsPackage.TRANSACTION_RESPONSE_TYPE__VERSION:
401: return getVersion();
402: }
403: return super .eGet(featureID, resolve, coreType);
404: }
405:
406: /**
407: * <!-- begin-user-doc -->
408: * <!-- end-user-doc -->
409: * @generated
410: */
411: public void eSet(int featureID, Object newValue) {
412: switch (featureID) {
413: case WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_SUMMARY:
414: setTransactionSummary((TransactionSummaryType) newValue);
415: return;
416: case WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_RESULTS:
417: setTransactionResults((TransactionResultsType) newValue);
418: return;
419: case WfsPackage.TRANSACTION_RESPONSE_TYPE__INSERT_RESULTS:
420: setInsertResults((InsertResultsType) newValue);
421: return;
422: case WfsPackage.TRANSACTION_RESPONSE_TYPE__VERSION:
423: setVersion((String) newValue);
424: return;
425: }
426: super .eSet(featureID, newValue);
427: }
428:
429: /**
430: * <!-- begin-user-doc -->
431: * <!-- end-user-doc -->
432: * @generated
433: */
434: public void eUnset(int featureID) {
435: switch (featureID) {
436: case WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_SUMMARY:
437: setTransactionSummary((TransactionSummaryType) null);
438: return;
439: case WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_RESULTS:
440: setTransactionResults((TransactionResultsType) null);
441: return;
442: case WfsPackage.TRANSACTION_RESPONSE_TYPE__INSERT_RESULTS:
443: setInsertResults((InsertResultsType) null);
444: return;
445: case WfsPackage.TRANSACTION_RESPONSE_TYPE__VERSION:
446: unsetVersion();
447: return;
448: }
449: super .eUnset(featureID);
450: }
451:
452: /**
453: * <!-- begin-user-doc -->
454: * <!-- end-user-doc -->
455: * @generated
456: */
457: public boolean eIsSet(int featureID) {
458: switch (featureID) {
459: case WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_SUMMARY:
460: return transactionSummary != null;
461: case WfsPackage.TRANSACTION_RESPONSE_TYPE__TRANSACTION_RESULTS:
462: return transactionResults != null;
463: case WfsPackage.TRANSACTION_RESPONSE_TYPE__INSERT_RESULTS:
464: return insertResults != null;
465: case WfsPackage.TRANSACTION_RESPONSE_TYPE__VERSION:
466: return isSetVersion();
467: }
468: return super .eIsSet(featureID);
469: }
470:
471: /**
472: * <!-- begin-user-doc -->
473: * <!-- end-user-doc -->
474: * @generated
475: */
476: public String toString() {
477: if (eIsProxy())
478: return super .toString();
479:
480: StringBuffer result = new StringBuffer(super .toString());
481: result.append(" (version: ");
482: if (versionESet)
483: result.append(version);
484: else
485: result.append("<unset>");
486: result.append(')');
487: return result.toString();
488: }
489:
490: } //TransactionResponseTypeImpl
|