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