001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: UpdateElementTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.wfs.impl;
007:
008: import java.net.URI;
009:
010: import java.util.Collection;
011:
012: import javax.xml.namespace.QName;
013:
014: import net.opengis.wfs.PropertyType;
015: import net.opengis.wfs.UpdateElementType;
016: import net.opengis.wfs.WfsPackage;
017:
018: import org.eclipse.emf.common.notify.Notification;
019: import org.eclipse.emf.common.notify.NotificationChain;
020:
021: import org.eclipse.emf.common.util.EList;
022:
023: import org.eclipse.emf.ecore.EClass;
024: import org.eclipse.emf.ecore.InternalEObject;
025:
026: import org.eclipse.emf.ecore.impl.ENotificationImpl;
027: import org.eclipse.emf.ecore.impl.EObjectImpl;
028:
029: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
030: import org.eclipse.emf.ecore.util.InternalEList;
031:
032: import org.opengis.filter.Filter;
033:
034: /**
035: * <!-- begin-user-doc -->
036: * An implementation of the model object '<em><b>Update Element Type</b></em>'.
037: * <!-- end-user-doc -->
038: * <p>
039: * The following features are implemented:
040: * <ul>
041: * <li>{@link net.opengis.wfs.impl.UpdateElementTypeImpl#getProperty <em>Property</em>}</li>
042: * <li>{@link net.opengis.wfs.impl.UpdateElementTypeImpl#getFilter <em>Filter</em>}</li>
043: * <li>{@link net.opengis.wfs.impl.UpdateElementTypeImpl#getHandle <em>Handle</em>}</li>
044: * <li>{@link net.opengis.wfs.impl.UpdateElementTypeImpl#getInputFormat <em>Input Format</em>}</li>
045: * <li>{@link net.opengis.wfs.impl.UpdateElementTypeImpl#getSrsName <em>Srs Name</em>}</li>
046: * <li>{@link net.opengis.wfs.impl.UpdateElementTypeImpl#getTypeName <em>Type Name</em>}</li>
047: * </ul>
048: * </p>
049: *
050: * @generated
051: */
052: public class UpdateElementTypeImpl extends EObjectImpl implements
053: UpdateElementType {
054: /**
055: * The cached value of the '{@link #getProperty() <em>Property</em>}' containment reference list.
056: * <!-- begin-user-doc -->
057: * <!-- end-user-doc -->
058: * @see #getProperty()
059: * @generated
060: * @ordered
061: */
062: protected EList property;
063:
064: /**
065: * The default value of the '{@link #getFilter() <em>Filter</em>}' attribute.
066: * <!-- begin-user-doc -->
067: * <!-- end-user-doc -->
068: * @see #getFilter()
069: * @generated
070: * @ordered
071: */
072: protected static final Filter FILTER_EDEFAULT = null;
073:
074: /**
075: * The cached value of the '{@link #getFilter() <em>Filter</em>}' attribute.
076: * <!-- begin-user-doc -->
077: * <!-- end-user-doc -->
078: * @see #getFilter()
079: * @generated
080: * @ordered
081: */
082: protected Filter filter = FILTER_EDEFAULT;
083:
084: /**
085: * The default value of the '{@link #getHandle() <em>Handle</em>}' attribute.
086: * <!-- begin-user-doc -->
087: * <!-- end-user-doc -->
088: * @see #getHandle()
089: * @generated
090: * @ordered
091: */
092: protected static final String HANDLE_EDEFAULT = null;
093:
094: /**
095: * The cached value of the '{@link #getHandle() <em>Handle</em>}' attribute.
096: * <!-- begin-user-doc -->
097: * <!-- end-user-doc -->
098: * @see #getHandle()
099: * @generated
100: * @ordered
101: */
102: protected String handle = HANDLE_EDEFAULT;
103:
104: /**
105: * The default value of the '{@link #getInputFormat() <em>Input Format</em>}' attribute.
106: * <!-- begin-user-doc -->
107: * <!-- end-user-doc -->
108: * @see #getInputFormat()
109: * @generated
110: * @ordered
111: */
112: protected static final String INPUT_FORMAT_EDEFAULT = "x-application/gml:3";
113:
114: /**
115: * The cached value of the '{@link #getInputFormat() <em>Input Format</em>}' attribute.
116: * <!-- begin-user-doc -->
117: * <!-- end-user-doc -->
118: * @see #getInputFormat()
119: * @generated
120: * @ordered
121: */
122: protected String inputFormat = INPUT_FORMAT_EDEFAULT;
123:
124: /**
125: * This is true if the Input Format attribute has been set.
126: * <!-- begin-user-doc -->
127: * <!-- end-user-doc -->
128: * @generated
129: * @ordered
130: */
131: protected boolean inputFormatESet;
132:
133: /**
134: * The default value of the '{@link #getSrsName() <em>Srs Name</em>}' attribute.
135: * <!-- begin-user-doc -->
136: * <!-- end-user-doc -->
137: * @see #getSrsName()
138: * @generated
139: * @ordered
140: */
141: protected static final URI SRS_NAME_EDEFAULT = null;
142:
143: /**
144: * The cached value of the '{@link #getSrsName() <em>Srs Name</em>}' attribute.
145: * <!-- begin-user-doc -->
146: * <!-- end-user-doc -->
147: * @see #getSrsName()
148: * @generated
149: * @ordered
150: */
151: protected URI srsName = SRS_NAME_EDEFAULT;
152:
153: /**
154: * The default value of the '{@link #getTypeName() <em>Type Name</em>}' attribute.
155: * <!-- begin-user-doc -->
156: * <!-- end-user-doc -->
157: * @see #getTypeName()
158: * @generated
159: * @ordered
160: */
161: protected static final QName TYPE_NAME_EDEFAULT = null;
162:
163: /**
164: * The cached value of the '{@link #getTypeName() <em>Type Name</em>}' attribute.
165: * <!-- begin-user-doc -->
166: * <!-- end-user-doc -->
167: * @see #getTypeName()
168: * @generated
169: * @ordered
170: */
171: protected QName typeName = TYPE_NAME_EDEFAULT;
172:
173: /**
174: * <!-- begin-user-doc -->
175: * <!-- end-user-doc -->
176: * @generated
177: */
178: protected UpdateElementTypeImpl() {
179: super ();
180: }
181:
182: /**
183: * <!-- begin-user-doc -->
184: * <!-- end-user-doc -->
185: * @generated
186: */
187: protected EClass eStaticClass() {
188: return WfsPackage.Literals.UPDATE_ELEMENT_TYPE;
189: }
190:
191: /**
192: * <!-- begin-user-doc -->
193: * <!-- end-user-doc -->
194: * @generated
195: */
196: public EList getProperty() {
197: if (property == null) {
198: property = new EObjectContainmentEList(PropertyType.class,
199: this , WfsPackage.UPDATE_ELEMENT_TYPE__PROPERTY);
200: }
201: return property;
202: }
203:
204: /**
205: * <!-- begin-user-doc -->
206: * <!-- end-user-doc -->
207: * @generated
208: */
209: public Filter getFilter() {
210: return filter;
211: }
212:
213: /**
214: * <!-- begin-user-doc -->
215: * <!-- end-user-doc -->
216: * @generated
217: */
218: public void setFilter(Filter newFilter) {
219: Filter oldFilter = filter;
220: filter = newFilter;
221: if (eNotificationRequired())
222: eNotify(new ENotificationImpl(this , Notification.SET,
223: WfsPackage.UPDATE_ELEMENT_TYPE__FILTER, oldFilter,
224: filter));
225: }
226:
227: /**
228: * <!-- begin-user-doc -->
229: * <!-- end-user-doc -->
230: * @generated
231: */
232: public String getHandle() {
233: return handle;
234: }
235:
236: /**
237: * <!-- begin-user-doc -->
238: * <!-- end-user-doc -->
239: * @generated
240: */
241: public void setHandle(String newHandle) {
242: String oldHandle = handle;
243: handle = newHandle;
244: if (eNotificationRequired())
245: eNotify(new ENotificationImpl(this , Notification.SET,
246: WfsPackage.UPDATE_ELEMENT_TYPE__HANDLE, oldHandle,
247: handle));
248: }
249:
250: /**
251: * <!-- begin-user-doc -->
252: * <!-- end-user-doc -->
253: * @generated
254: */
255: public String getInputFormat() {
256: return inputFormat;
257: }
258:
259: /**
260: * <!-- begin-user-doc -->
261: * <!-- end-user-doc -->
262: * @generated
263: */
264: public void setInputFormat(String newInputFormat) {
265: String oldInputFormat = inputFormat;
266: inputFormat = newInputFormat;
267: boolean oldInputFormatESet = inputFormatESet;
268: inputFormatESet = true;
269: if (eNotificationRequired())
270: eNotify(new ENotificationImpl(this , Notification.SET,
271: WfsPackage.UPDATE_ELEMENT_TYPE__INPUT_FORMAT,
272: oldInputFormat, inputFormat, !oldInputFormatESet));
273: }
274:
275: /**
276: * <!-- begin-user-doc -->
277: * <!-- end-user-doc -->
278: * @generated
279: */
280: public void unsetInputFormat() {
281: String oldInputFormat = inputFormat;
282: boolean oldInputFormatESet = inputFormatESet;
283: inputFormat = INPUT_FORMAT_EDEFAULT;
284: inputFormatESet = false;
285: if (eNotificationRequired())
286: eNotify(new ENotificationImpl(this , Notification.UNSET,
287: WfsPackage.UPDATE_ELEMENT_TYPE__INPUT_FORMAT,
288: oldInputFormat, INPUT_FORMAT_EDEFAULT,
289: oldInputFormatESet));
290: }
291:
292: /**
293: * <!-- begin-user-doc -->
294: * <!-- end-user-doc -->
295: * @generated
296: */
297: public boolean isSetInputFormat() {
298: return inputFormatESet;
299: }
300:
301: /**
302: * <!-- begin-user-doc -->
303: * <!-- end-user-doc -->
304: * @generated
305: */
306: public URI getSrsName() {
307: return srsName;
308: }
309:
310: /**
311: * <!-- begin-user-doc -->
312: * <!-- end-user-doc -->
313: * @generated
314: */
315: public void setSrsName(URI newSrsName) {
316: URI oldSrsName = srsName;
317: srsName = newSrsName;
318: if (eNotificationRequired())
319: eNotify(new ENotificationImpl(this , Notification.SET,
320: WfsPackage.UPDATE_ELEMENT_TYPE__SRS_NAME,
321: oldSrsName, srsName));
322: }
323:
324: /**
325: * <!-- begin-user-doc -->
326: * <!-- end-user-doc -->
327: * @generated
328: */
329: public QName getTypeName() {
330: return typeName;
331: }
332:
333: /**
334: * <!-- begin-user-doc -->
335: * <!-- end-user-doc -->
336: * @generated
337: */
338: public void setTypeName(QName newTypeName) {
339: QName oldTypeName = typeName;
340: typeName = newTypeName;
341: if (eNotificationRequired())
342: eNotify(new ENotificationImpl(this , Notification.SET,
343: WfsPackage.UPDATE_ELEMENT_TYPE__TYPE_NAME,
344: oldTypeName, typeName));
345: }
346:
347: /**
348: * <!-- begin-user-doc -->
349: * <!-- end-user-doc -->
350: * @generated
351: */
352: public NotificationChain eInverseRemove(InternalEObject otherEnd,
353: int featureID, NotificationChain msgs) {
354: switch (featureID) {
355: case WfsPackage.UPDATE_ELEMENT_TYPE__PROPERTY:
356: return ((InternalEList) getProperty()).basicRemove(
357: otherEnd, msgs);
358: }
359: return super .eInverseRemove(otherEnd, featureID, msgs);
360: }
361:
362: /**
363: * <!-- begin-user-doc -->
364: * <!-- end-user-doc -->
365: * @generated
366: */
367: public Object eGet(int featureID, boolean resolve, boolean coreType) {
368: switch (featureID) {
369: case WfsPackage.UPDATE_ELEMENT_TYPE__PROPERTY:
370: return getProperty();
371: case WfsPackage.UPDATE_ELEMENT_TYPE__FILTER:
372: return getFilter();
373: case WfsPackage.UPDATE_ELEMENT_TYPE__HANDLE:
374: return getHandle();
375: case WfsPackage.UPDATE_ELEMENT_TYPE__INPUT_FORMAT:
376: return getInputFormat();
377: case WfsPackage.UPDATE_ELEMENT_TYPE__SRS_NAME:
378: return getSrsName();
379: case WfsPackage.UPDATE_ELEMENT_TYPE__TYPE_NAME:
380: return getTypeName();
381: }
382: return super .eGet(featureID, resolve, coreType);
383: }
384:
385: /**
386: * <!-- begin-user-doc -->
387: * <!-- end-user-doc -->
388: * @generated
389: */
390: public void eSet(int featureID, Object newValue) {
391: switch (featureID) {
392: case WfsPackage.UPDATE_ELEMENT_TYPE__PROPERTY:
393: getProperty().clear();
394: getProperty().addAll((Collection) newValue);
395: return;
396: case WfsPackage.UPDATE_ELEMENT_TYPE__FILTER:
397: setFilter((Filter) newValue);
398: return;
399: case WfsPackage.UPDATE_ELEMENT_TYPE__HANDLE:
400: setHandle((String) newValue);
401: return;
402: case WfsPackage.UPDATE_ELEMENT_TYPE__INPUT_FORMAT:
403: setInputFormat((String) newValue);
404: return;
405: case WfsPackage.UPDATE_ELEMENT_TYPE__SRS_NAME:
406: setSrsName((URI) newValue);
407: return;
408: case WfsPackage.UPDATE_ELEMENT_TYPE__TYPE_NAME:
409: setTypeName((QName) newValue);
410: return;
411: }
412: super .eSet(featureID, newValue);
413: }
414:
415: /**
416: * <!-- begin-user-doc -->
417: * <!-- end-user-doc -->
418: * @generated
419: */
420: public void eUnset(int featureID) {
421: switch (featureID) {
422: case WfsPackage.UPDATE_ELEMENT_TYPE__PROPERTY:
423: getProperty().clear();
424: return;
425: case WfsPackage.UPDATE_ELEMENT_TYPE__FILTER:
426: setFilter(FILTER_EDEFAULT);
427: return;
428: case WfsPackage.UPDATE_ELEMENT_TYPE__HANDLE:
429: setHandle(HANDLE_EDEFAULT);
430: return;
431: case WfsPackage.UPDATE_ELEMENT_TYPE__INPUT_FORMAT:
432: unsetInputFormat();
433: return;
434: case WfsPackage.UPDATE_ELEMENT_TYPE__SRS_NAME:
435: setSrsName(SRS_NAME_EDEFAULT);
436: return;
437: case WfsPackage.UPDATE_ELEMENT_TYPE__TYPE_NAME:
438: setTypeName(TYPE_NAME_EDEFAULT);
439: return;
440: }
441: super .eUnset(featureID);
442: }
443:
444: /**
445: * <!-- begin-user-doc -->
446: * <!-- end-user-doc -->
447: * @generated
448: */
449: public boolean eIsSet(int featureID) {
450: switch (featureID) {
451: case WfsPackage.UPDATE_ELEMENT_TYPE__PROPERTY:
452: return property != null && !property.isEmpty();
453: case WfsPackage.UPDATE_ELEMENT_TYPE__FILTER:
454: return FILTER_EDEFAULT == null ? filter != null
455: : !FILTER_EDEFAULT.equals(filter);
456: case WfsPackage.UPDATE_ELEMENT_TYPE__HANDLE:
457: return HANDLE_EDEFAULT == null ? handle != null
458: : !HANDLE_EDEFAULT.equals(handle);
459: case WfsPackage.UPDATE_ELEMENT_TYPE__INPUT_FORMAT:
460: return isSetInputFormat();
461: case WfsPackage.UPDATE_ELEMENT_TYPE__SRS_NAME:
462: return SRS_NAME_EDEFAULT == null ? srsName != null
463: : !SRS_NAME_EDEFAULT.equals(srsName);
464: case WfsPackage.UPDATE_ELEMENT_TYPE__TYPE_NAME:
465: return TYPE_NAME_EDEFAULT == null ? typeName != null
466: : !TYPE_NAME_EDEFAULT.equals(typeName);
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(" (filter: ");
482: result.append(filter);
483: result.append(", handle: ");
484: result.append(handle);
485: result.append(", inputFormat: ");
486: if (inputFormatESet)
487: result.append(inputFormat);
488: else
489: result.append("<unset>");
490: result.append(", srsName: ");
491: result.append(srsName);
492: result.append(", typeName: ");
493: result.append(typeName);
494: result.append(')');
495: return result.toString();
496: }
497:
498: } //UpdateElementTypeImpl
|