001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: OperationsMetadataTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.ows.impl;
007:
008: import java.util.Collection;
009:
010: import net.opengis.ows.DomainType;
011: import net.opengis.ows.OperationType;
012: import net.opengis.ows.OperationsMetadataType;
013: import net.opengis.ows.OwsPackage;
014:
015: import org.eclipse.emf.common.notify.Notification;
016: import org.eclipse.emf.common.notify.NotificationChain;
017:
018: import org.eclipse.emf.common.util.EList;
019:
020: import org.eclipse.emf.ecore.EClass;
021: import org.eclipse.emf.ecore.EObject;
022: import org.eclipse.emf.ecore.InternalEObject;
023:
024: import org.eclipse.emf.ecore.impl.ENotificationImpl;
025: import org.eclipse.emf.ecore.impl.EObjectImpl;
026:
027: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
028: import org.eclipse.emf.ecore.util.InternalEList;
029:
030: /**
031: * <!-- begin-user-doc -->
032: * An implementation of the model object '<em><b>Operations Metadata Type</b></em>'.
033: * <!-- end-user-doc -->
034: * <p>
035: * The following features are implemented:
036: * <ul>
037: * <li>{@link net.opengis.ows.impl.OperationsMetadataTypeImpl#getOperation <em>Operation</em>}</li>
038: * <li>{@link net.opengis.ows.impl.OperationsMetadataTypeImpl#getParameter <em>Parameter</em>}</li>
039: * <li>{@link net.opengis.ows.impl.OperationsMetadataTypeImpl#getConstraint <em>Constraint</em>}</li>
040: * <li>{@link net.opengis.ows.impl.OperationsMetadataTypeImpl#getExtendedCapabilities <em>Extended Capabilities</em>}</li>
041: * </ul>
042: * </p>
043: *
044: * @generated
045: */
046: public class OperationsMetadataTypeImpl extends EObjectImpl implements
047: OperationsMetadataType {
048: /**
049: * The cached value of the '{@link #getOperation() <em>Operation</em>}' containment reference list.
050: * <!-- begin-user-doc -->
051: * <!-- end-user-doc -->
052: * @see #getOperation()
053: * @generated
054: * @ordered
055: */
056: protected EList operation;
057:
058: /**
059: * The cached value of the '{@link #getParameter() <em>Parameter</em>}' containment reference list.
060: * <!-- begin-user-doc -->
061: * <!-- end-user-doc -->
062: * @see #getParameter()
063: * @generated
064: * @ordered
065: */
066: protected EList parameter;
067:
068: /**
069: * The cached value of the '{@link #getConstraint() <em>Constraint</em>}' containment reference list.
070: * <!-- begin-user-doc -->
071: * <!-- end-user-doc -->
072: * @see #getConstraint()
073: * @generated
074: * @ordered
075: */
076: protected EList constraint;
077:
078: /**
079: * The cached value of the '{@link #getExtendedCapabilities() <em>Extended Capabilities</em>}' containment reference.
080: * <!-- begin-user-doc -->
081: * <!-- end-user-doc -->
082: * @see #getExtendedCapabilities()
083: * @generated
084: * @ordered
085: */
086: protected EObject extendedCapabilities;
087:
088: /**
089: * <!-- begin-user-doc -->
090: * <!-- end-user-doc -->
091: * @generated
092: */
093: protected OperationsMetadataTypeImpl() {
094: super ();
095: }
096:
097: /**
098: * <!-- begin-user-doc -->
099: * <!-- end-user-doc -->
100: * @generated
101: */
102: protected EClass eStaticClass() {
103: return OwsPackage.Literals.OPERATIONS_METADATA_TYPE;
104: }
105:
106: /**
107: * <!-- begin-user-doc -->
108: * <!-- end-user-doc -->
109: * @generated
110: */
111: public EList getOperation() {
112: if (operation == null) {
113: operation = new EObjectContainmentEList(
114: OperationType.class, this ,
115: OwsPackage.OPERATIONS_METADATA_TYPE__OPERATION);
116: }
117: return operation;
118: }
119:
120: /**
121: * <!-- begin-user-doc -->
122: * <!-- end-user-doc -->
123: * @generated
124: */
125: public EList getParameter() {
126: if (parameter == null) {
127: parameter = new EObjectContainmentEList(DomainType.class,
128: this ,
129: OwsPackage.OPERATIONS_METADATA_TYPE__PARAMETER);
130: }
131: return parameter;
132: }
133:
134: /**
135: * <!-- begin-user-doc -->
136: * <!-- end-user-doc -->
137: * @generated
138: */
139: public EList getConstraint() {
140: if (constraint == null) {
141: constraint = new EObjectContainmentEList(DomainType.class,
142: this ,
143: OwsPackage.OPERATIONS_METADATA_TYPE__CONSTRAINT);
144: }
145: return constraint;
146: }
147:
148: /**
149: * <!-- begin-user-doc -->
150: * <!-- end-user-doc -->
151: * @generated
152: */
153: public EObject getExtendedCapabilities() {
154: return extendedCapabilities;
155: }
156:
157: /**
158: * <!-- begin-user-doc -->
159: * <!-- end-user-doc -->
160: * @generated
161: */
162: public NotificationChain basicSetExtendedCapabilities(
163: EObject newExtendedCapabilities, NotificationChain msgs) {
164: EObject oldExtendedCapabilities = extendedCapabilities;
165: extendedCapabilities = newExtendedCapabilities;
166: if (eNotificationRequired()) {
167: ENotificationImpl notification = new ENotificationImpl(
168: this ,
169: Notification.SET,
170: OwsPackage.OPERATIONS_METADATA_TYPE__EXTENDED_CAPABILITIES,
171: oldExtendedCapabilities, newExtendedCapabilities);
172: if (msgs == null)
173: msgs = notification;
174: else
175: msgs.add(notification);
176: }
177: return msgs;
178: }
179:
180: /**
181: * <!-- begin-user-doc -->
182: * <!-- end-user-doc -->
183: * @generated
184: */
185: public void setExtendedCapabilities(EObject newExtendedCapabilities) {
186: if (newExtendedCapabilities != extendedCapabilities) {
187: NotificationChain msgs = null;
188: if (extendedCapabilities != null)
189: msgs = ((InternalEObject) extendedCapabilities)
190: .eInverseRemove(
191: this ,
192: EOPPOSITE_FEATURE_BASE
193: - OwsPackage.OPERATIONS_METADATA_TYPE__EXTENDED_CAPABILITIES,
194: null, msgs);
195: if (newExtendedCapabilities != null)
196: msgs = ((InternalEObject) newExtendedCapabilities)
197: .eInverseAdd(
198: this ,
199: EOPPOSITE_FEATURE_BASE
200: - OwsPackage.OPERATIONS_METADATA_TYPE__EXTENDED_CAPABILITIES,
201: null, msgs);
202: msgs = basicSetExtendedCapabilities(
203: newExtendedCapabilities, msgs);
204: if (msgs != null)
205: msgs.dispatch();
206: } else if (eNotificationRequired())
207: eNotify(new ENotificationImpl(
208: this ,
209: Notification.SET,
210: OwsPackage.OPERATIONS_METADATA_TYPE__EXTENDED_CAPABILITIES,
211: newExtendedCapabilities, newExtendedCapabilities));
212: }
213:
214: /**
215: * <!-- begin-user-doc -->
216: * <!-- end-user-doc -->
217: * @generated
218: */
219: public NotificationChain eInverseRemove(InternalEObject otherEnd,
220: int featureID, NotificationChain msgs) {
221: switch (featureID) {
222: case OwsPackage.OPERATIONS_METADATA_TYPE__OPERATION:
223: return ((InternalEList) getOperation()).basicRemove(
224: otherEnd, msgs);
225: case OwsPackage.OPERATIONS_METADATA_TYPE__PARAMETER:
226: return ((InternalEList) getParameter()).basicRemove(
227: otherEnd, msgs);
228: case OwsPackage.OPERATIONS_METADATA_TYPE__CONSTRAINT:
229: return ((InternalEList) getConstraint()).basicRemove(
230: otherEnd, msgs);
231: case OwsPackage.OPERATIONS_METADATA_TYPE__EXTENDED_CAPABILITIES:
232: return basicSetExtendedCapabilities(null, msgs);
233: }
234: return super .eInverseRemove(otherEnd, featureID, msgs);
235: }
236:
237: /**
238: * <!-- begin-user-doc -->
239: * <!-- end-user-doc -->
240: * @generated
241: */
242: public Object eGet(int featureID, boolean resolve, boolean coreType) {
243: switch (featureID) {
244: case OwsPackage.OPERATIONS_METADATA_TYPE__OPERATION:
245: return getOperation();
246: case OwsPackage.OPERATIONS_METADATA_TYPE__PARAMETER:
247: return getParameter();
248: case OwsPackage.OPERATIONS_METADATA_TYPE__CONSTRAINT:
249: return getConstraint();
250: case OwsPackage.OPERATIONS_METADATA_TYPE__EXTENDED_CAPABILITIES:
251: return getExtendedCapabilities();
252: }
253: return super .eGet(featureID, resolve, coreType);
254: }
255:
256: /**
257: * <!-- begin-user-doc -->
258: * <!-- end-user-doc -->
259: * @generated
260: */
261: public void eSet(int featureID, Object newValue) {
262: switch (featureID) {
263: case OwsPackage.OPERATIONS_METADATA_TYPE__OPERATION:
264: getOperation().clear();
265: getOperation().addAll((Collection) newValue);
266: return;
267: case OwsPackage.OPERATIONS_METADATA_TYPE__PARAMETER:
268: getParameter().clear();
269: getParameter().addAll((Collection) newValue);
270: return;
271: case OwsPackage.OPERATIONS_METADATA_TYPE__CONSTRAINT:
272: getConstraint().clear();
273: getConstraint().addAll((Collection) newValue);
274: return;
275: case OwsPackage.OPERATIONS_METADATA_TYPE__EXTENDED_CAPABILITIES:
276: setExtendedCapabilities((EObject) newValue);
277: return;
278: }
279: super .eSet(featureID, newValue);
280: }
281:
282: /**
283: * <!-- begin-user-doc -->
284: * <!-- end-user-doc -->
285: * @generated
286: */
287: public void eUnset(int featureID) {
288: switch (featureID) {
289: case OwsPackage.OPERATIONS_METADATA_TYPE__OPERATION:
290: getOperation().clear();
291: return;
292: case OwsPackage.OPERATIONS_METADATA_TYPE__PARAMETER:
293: getParameter().clear();
294: return;
295: case OwsPackage.OPERATIONS_METADATA_TYPE__CONSTRAINT:
296: getConstraint().clear();
297: return;
298: case OwsPackage.OPERATIONS_METADATA_TYPE__EXTENDED_CAPABILITIES:
299: setExtendedCapabilities((EObject) null);
300: return;
301: }
302: super .eUnset(featureID);
303: }
304:
305: /**
306: * <!-- begin-user-doc -->
307: * <!-- end-user-doc -->
308: * @generated
309: */
310: public boolean eIsSet(int featureID) {
311: switch (featureID) {
312: case OwsPackage.OPERATIONS_METADATA_TYPE__OPERATION:
313: return operation != null && !operation.isEmpty();
314: case OwsPackage.OPERATIONS_METADATA_TYPE__PARAMETER:
315: return parameter != null && !parameter.isEmpty();
316: case OwsPackage.OPERATIONS_METADATA_TYPE__CONSTRAINT:
317: return constraint != null && !constraint.isEmpty();
318: case OwsPackage.OPERATIONS_METADATA_TYPE__EXTENDED_CAPABILITIES:
319: return extendedCapabilities != null;
320: }
321: return super .eIsSet(featureID);
322: }
323:
324: } //OperationsMetadataTypeImpl
|