001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: TransactionResultsTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.wfs.impl;
007:
008: import java.util.Collection;
009:
010: import net.opengis.wfs.ActionType;
011: import net.opengis.wfs.TransactionResultsType;
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.common.util.EList;
018:
019: import org.eclipse.emf.ecore.EClass;
020: import org.eclipse.emf.ecore.InternalEObject;
021:
022: import org.eclipse.emf.ecore.impl.ENotificationImpl;
023: import org.eclipse.emf.ecore.impl.EObjectImpl;
024:
025: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
026: import org.eclipse.emf.ecore.util.InternalEList;
027:
028: /**
029: * <!-- begin-user-doc -->
030: * An implementation of the model object '<em><b>Transaction Results Type</b></em>'.
031: * <!-- end-user-doc -->
032: * <p>
033: * The following features are implemented:
034: * <ul>
035: * <li>{@link net.opengis.wfs.impl.TransactionResultsTypeImpl#getHandle <em>Handle</em>}</li>
036: * <li>{@link net.opengis.wfs.impl.TransactionResultsTypeImpl#getAction <em>Action</em>}</li>
037: * </ul>
038: * </p>
039: *
040: * @generated
041: */
042: public class TransactionResultsTypeImpl extends EObjectImpl implements
043: TransactionResultsType {
044: /**
045: * The default value of the '{@link #getHandle() <em>Handle</em>}' attribute.
046: * <!-- begin-user-doc -->
047: * <!-- end-user-doc -->
048: * @see #getHandle()
049: * @generated
050: * @ordered
051: */
052: protected static final String HANDLE_EDEFAULT = null;
053:
054: /**
055: * The cached value of the '{@link #getHandle() <em>Handle</em>}' attribute.
056: * <!-- begin-user-doc -->
057: * <!-- end-user-doc -->
058: * @see #getHandle()
059: * @generated
060: * @ordered
061: */
062: protected String handle = HANDLE_EDEFAULT;
063:
064: /**
065: * The cached value of the '{@link #getAction() <em>Action</em>}' containment reference list.
066: * <!-- begin-user-doc -->
067: * <!-- end-user-doc -->
068: * @see #getAction()
069: * @generated
070: * @ordered
071: */
072: protected EList action;
073:
074: /**
075: * <!-- begin-user-doc -->
076: * <!-- end-user-doc -->
077: * @generated
078: */
079: protected TransactionResultsTypeImpl() {
080: super ();
081: }
082:
083: /**
084: * <!-- begin-user-doc -->
085: * <!-- end-user-doc -->
086: * @generated
087: */
088: protected EClass eStaticClass() {
089: return WfsPackage.Literals.TRANSACTION_RESULTS_TYPE;
090: }
091:
092: /**
093: * <!-- begin-user-doc -->
094: * <!-- end-user-doc -->
095: * @generated
096: */
097: public String getHandle() {
098: return handle;
099: }
100:
101: /**
102: * <!-- begin-user-doc -->
103: * <!-- end-user-doc -->
104: * @generated
105: */
106: public void setHandle(String newHandle) {
107: String oldHandle = handle;
108: handle = newHandle;
109: if (eNotificationRequired())
110: eNotify(new ENotificationImpl(this , Notification.SET,
111: WfsPackage.TRANSACTION_RESULTS_TYPE__HANDLE,
112: oldHandle, handle));
113: }
114:
115: /**
116: * <!-- begin-user-doc -->
117: * <!-- end-user-doc -->
118: * @generated
119: */
120: public EList getAction() {
121: if (action == null) {
122: action = new EObjectContainmentEList(ActionType.class,
123: this , WfsPackage.TRANSACTION_RESULTS_TYPE__ACTION);
124: }
125: return action;
126: }
127:
128: /**
129: * <!-- begin-user-doc -->
130: * <!-- end-user-doc -->
131: * @generated
132: */
133: public NotificationChain eInverseRemove(InternalEObject otherEnd,
134: int featureID, NotificationChain msgs) {
135: switch (featureID) {
136: case WfsPackage.TRANSACTION_RESULTS_TYPE__ACTION:
137: return ((InternalEList) getAction()).basicRemove(otherEnd,
138: msgs);
139: }
140: return super .eInverseRemove(otherEnd, featureID, msgs);
141: }
142:
143: /**
144: * <!-- begin-user-doc -->
145: * <!-- end-user-doc -->
146: * @generated
147: */
148: public Object eGet(int featureID, boolean resolve, boolean coreType) {
149: switch (featureID) {
150: case WfsPackage.TRANSACTION_RESULTS_TYPE__HANDLE:
151: return getHandle();
152: case WfsPackage.TRANSACTION_RESULTS_TYPE__ACTION:
153: return getAction();
154: }
155: return super .eGet(featureID, resolve, coreType);
156: }
157:
158: /**
159: * <!-- begin-user-doc -->
160: * <!-- end-user-doc -->
161: * @generated
162: */
163: public void eSet(int featureID, Object newValue) {
164: switch (featureID) {
165: case WfsPackage.TRANSACTION_RESULTS_TYPE__HANDLE:
166: setHandle((String) newValue);
167: return;
168: case WfsPackage.TRANSACTION_RESULTS_TYPE__ACTION:
169: getAction().clear();
170: getAction().addAll((Collection) newValue);
171: return;
172: }
173: super .eSet(featureID, newValue);
174: }
175:
176: /**
177: * <!-- begin-user-doc -->
178: * <!-- end-user-doc -->
179: * @generated
180: */
181: public void eUnset(int featureID) {
182: switch (featureID) {
183: case WfsPackage.TRANSACTION_RESULTS_TYPE__HANDLE:
184: setHandle(HANDLE_EDEFAULT);
185: return;
186: case WfsPackage.TRANSACTION_RESULTS_TYPE__ACTION:
187: getAction().clear();
188: return;
189: }
190: super .eUnset(featureID);
191: }
192:
193: /**
194: * <!-- begin-user-doc -->
195: * <!-- end-user-doc -->
196: * @generated
197: */
198: public boolean eIsSet(int featureID) {
199: switch (featureID) {
200: case WfsPackage.TRANSACTION_RESULTS_TYPE__HANDLE:
201: return HANDLE_EDEFAULT == null ? handle != null
202: : !HANDLE_EDEFAULT.equals(handle);
203: case WfsPackage.TRANSACTION_RESULTS_TYPE__ACTION:
204: return action != null && !action.isEmpty();
205: }
206: return super .eIsSet(featureID);
207: }
208:
209: /**
210: * <!-- begin-user-doc -->
211: * <!-- end-user-doc -->
212: * @generated
213: */
214: public String toString() {
215: if (eIsProxy())
216: return super .toString();
217:
218: StringBuffer result = new StringBuffer(super .toString());
219: result.append(" (handle: ");
220: result.append(handle);
221: result.append(')');
222: return result.toString();
223: }
224:
225: } //TransactionResultsTypeImpl
|