001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: GetFeatureTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.wfs.impl;
007:
008: import java.math.BigInteger;
009:
010: import java.util.Collection;
011:
012: import net.opengis.wfs.GetFeatureType;
013: import net.opengis.wfs.QueryType;
014: import net.opengis.wfs.ResultTypeType;
015: import net.opengis.wfs.WfsPackage;
016:
017: import org.eclipse.emf.common.notify.Notification;
018: import org.eclipse.emf.common.notify.NotificationChain;
019:
020: import org.eclipse.emf.common.util.EList;
021:
022: import org.eclipse.emf.ecore.EClass;
023: import org.eclipse.emf.ecore.InternalEObject;
024:
025: import org.eclipse.emf.ecore.impl.ENotificationImpl;
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>Get Feature Type</b></em>'.
033: * <!-- end-user-doc -->
034: * <p>
035: * The following features are implemented:
036: * <ul>
037: * <li>{@link net.opengis.wfs.impl.GetFeatureTypeImpl#getQuery <em>Query</em>}</li>
038: * <li>{@link net.opengis.wfs.impl.GetFeatureTypeImpl#getMaxFeatures <em>Max Features</em>}</li>
039: * <li>{@link net.opengis.wfs.impl.GetFeatureTypeImpl#getOutputFormat <em>Output Format</em>}</li>
040: * <li>{@link net.opengis.wfs.impl.GetFeatureTypeImpl#getResultType <em>Result Type</em>}</li>
041: * <li>{@link net.opengis.wfs.impl.GetFeatureTypeImpl#getTraverseXlinkDepth <em>Traverse Xlink Depth</em>}</li>
042: * <li>{@link net.opengis.wfs.impl.GetFeatureTypeImpl#getTraverseXlinkExpiry <em>Traverse Xlink Expiry</em>}</li>
043: * </ul>
044: * </p>
045: *
046: * @generated
047: */
048: public class GetFeatureTypeImpl extends BaseRequestTypeImpl implements
049: GetFeatureType {
050: /**
051: * The cached value of the '{@link #getQuery() <em>Query</em>}' containment reference list.
052: * <!-- begin-user-doc -->
053: * <!-- end-user-doc -->
054: * @see #getQuery()
055: * @generated
056: * @ordered
057: */
058: protected EList query;
059:
060: /**
061: * The default value of the '{@link #getMaxFeatures() <em>Max Features</em>}' attribute.
062: * <!-- begin-user-doc -->
063: * <!-- end-user-doc -->
064: * @see #getMaxFeatures()
065: * @generated
066: * @ordered
067: */
068: protected static final BigInteger MAX_FEATURES_EDEFAULT = null;
069:
070: /**
071: * The cached value of the '{@link #getMaxFeatures() <em>Max Features</em>}' attribute.
072: * <!-- begin-user-doc -->
073: * <!-- end-user-doc -->
074: * @see #getMaxFeatures()
075: * @generated
076: * @ordered
077: */
078: protected BigInteger maxFeatures = MAX_FEATURES_EDEFAULT;
079:
080: /**
081: * The default value of the '{@link #getOutputFormat() <em>Output Format</em>}' attribute.
082: * <!-- begin-user-doc -->
083: * <!-- end-user-doc -->
084: * @see #getOutputFormat()
085: * @generated
086: * @ordered
087: */
088: protected static final String OUTPUT_FORMAT_EDEFAULT = "text/xml; subtype=gml/3.1.1";
089:
090: /**
091: * The cached value of the '{@link #getOutputFormat() <em>Output Format</em>}' attribute.
092: * <!-- begin-user-doc -->
093: * <!-- end-user-doc -->
094: * @see #getOutputFormat()
095: * @generated
096: * @ordered
097: */
098: protected String outputFormat = OUTPUT_FORMAT_EDEFAULT;
099:
100: /**
101: * This is true if the Output Format attribute has been set.
102: * <!-- begin-user-doc -->
103: * <!-- end-user-doc -->
104: * @generated
105: * @ordered
106: */
107: protected boolean outputFormatESet;
108:
109: /**
110: * The default value of the '{@link #getResultType() <em>Result Type</em>}' attribute.
111: * <!-- begin-user-doc -->
112: * <!-- end-user-doc -->
113: * @see #getResultType()
114: * @generated
115: * @ordered
116: */
117: protected static final ResultTypeType RESULT_TYPE_EDEFAULT = ResultTypeType.RESULTS_LITERAL;
118:
119: /**
120: * The cached value of the '{@link #getResultType() <em>Result Type</em>}' attribute.
121: * <!-- begin-user-doc -->
122: * <!-- end-user-doc -->
123: * @see #getResultType()
124: * @generated
125: * @ordered
126: */
127: protected ResultTypeType resultType = RESULT_TYPE_EDEFAULT;
128:
129: /**
130: * This is true if the Result Type attribute has been set.
131: * <!-- begin-user-doc -->
132: * <!-- end-user-doc -->
133: * @generated
134: * @ordered
135: */
136: protected boolean resultTypeESet;
137:
138: /**
139: * The default value of the '{@link #getTraverseXlinkDepth() <em>Traverse Xlink Depth</em>}' attribute.
140: * <!-- begin-user-doc -->
141: * <!-- end-user-doc -->
142: * @see #getTraverseXlinkDepth()
143: * @generated
144: * @ordered
145: */
146: protected static final String TRAVERSE_XLINK_DEPTH_EDEFAULT = null;
147:
148: /**
149: * The cached value of the '{@link #getTraverseXlinkDepth() <em>Traverse Xlink Depth</em>}' attribute.
150: * <!-- begin-user-doc -->
151: * <!-- end-user-doc -->
152: * @see #getTraverseXlinkDepth()
153: * @generated
154: * @ordered
155: */
156: protected String traverseXlinkDepth = TRAVERSE_XLINK_DEPTH_EDEFAULT;
157:
158: /**
159: * The default value of the '{@link #getTraverseXlinkExpiry() <em>Traverse Xlink Expiry</em>}' attribute.
160: * <!-- begin-user-doc -->
161: * <!-- end-user-doc -->
162: * @see #getTraverseXlinkExpiry()
163: * @generated
164: * @ordered
165: */
166: protected static final BigInteger TRAVERSE_XLINK_EXPIRY_EDEFAULT = null;
167:
168: /**
169: * The cached value of the '{@link #getTraverseXlinkExpiry() <em>Traverse Xlink Expiry</em>}' attribute.
170: * <!-- begin-user-doc -->
171: * <!-- end-user-doc -->
172: * @see #getTraverseXlinkExpiry()
173: * @generated
174: * @ordered
175: */
176: protected BigInteger traverseXlinkExpiry = TRAVERSE_XLINK_EXPIRY_EDEFAULT;
177:
178: /**
179: * <!-- begin-user-doc -->
180: * <!-- end-user-doc -->
181: * @generated
182: */
183: protected GetFeatureTypeImpl() {
184: super ();
185: }
186:
187: /**
188: * <!-- begin-user-doc -->
189: * <!-- end-user-doc -->
190: * @generated
191: */
192: protected EClass eStaticClass() {
193: return WfsPackage.Literals.GET_FEATURE_TYPE;
194: }
195:
196: /**
197: * <!-- begin-user-doc -->
198: * <!-- end-user-doc -->
199: * @generated
200: */
201: public EList getQuery() {
202: if (query == null) {
203: query = new EObjectContainmentEList(QueryType.class, this ,
204: WfsPackage.GET_FEATURE_TYPE__QUERY);
205: }
206: return query;
207: }
208:
209: /**
210: * <!-- begin-user-doc -->
211: * <!-- end-user-doc -->
212: * @generated
213: */
214: public BigInteger getMaxFeatures() {
215: return maxFeatures;
216: }
217:
218: /**
219: * <!-- begin-user-doc -->
220: * <!-- end-user-doc -->
221: * @generated
222: */
223: public void setMaxFeatures(BigInteger newMaxFeatures) {
224: BigInteger oldMaxFeatures = maxFeatures;
225: maxFeatures = newMaxFeatures;
226: if (eNotificationRequired())
227: eNotify(new ENotificationImpl(this , Notification.SET,
228: WfsPackage.GET_FEATURE_TYPE__MAX_FEATURES,
229: oldMaxFeatures, maxFeatures));
230: }
231:
232: /**
233: * <!-- begin-user-doc -->
234: * <!-- end-user-doc -->
235: * @generated
236: */
237: public String getOutputFormat() {
238: return outputFormat;
239: }
240:
241: /**
242: * <!-- begin-user-doc -->
243: * <!-- end-user-doc -->
244: * @generated
245: */
246: public void setOutputFormat(String newOutputFormat) {
247: String oldOutputFormat = outputFormat;
248: outputFormat = newOutputFormat;
249: boolean oldOutputFormatESet = outputFormatESet;
250: outputFormatESet = true;
251: if (eNotificationRequired())
252: eNotify(new ENotificationImpl(this , Notification.SET,
253: WfsPackage.GET_FEATURE_TYPE__OUTPUT_FORMAT,
254: oldOutputFormat, outputFormat, !oldOutputFormatESet));
255: }
256:
257: /**
258: * <!-- begin-user-doc -->
259: * <!-- end-user-doc -->
260: * @generated
261: */
262: public void unsetOutputFormat() {
263: String oldOutputFormat = outputFormat;
264: boolean oldOutputFormatESet = outputFormatESet;
265: outputFormat = OUTPUT_FORMAT_EDEFAULT;
266: outputFormatESet = false;
267: if (eNotificationRequired())
268: eNotify(new ENotificationImpl(this , Notification.UNSET,
269: WfsPackage.GET_FEATURE_TYPE__OUTPUT_FORMAT,
270: oldOutputFormat, OUTPUT_FORMAT_EDEFAULT,
271: oldOutputFormatESet));
272: }
273:
274: /**
275: * <!-- begin-user-doc -->
276: * <!-- end-user-doc -->
277: * @generated
278: */
279: public boolean isSetOutputFormat() {
280: return outputFormatESet;
281: }
282:
283: /**
284: * <!-- begin-user-doc -->
285: * <!-- end-user-doc -->
286: * @generated
287: */
288: public ResultTypeType getResultType() {
289: return resultType;
290: }
291:
292: /**
293: * <!-- begin-user-doc -->
294: * <!-- end-user-doc -->
295: * @generated
296: */
297: public void setResultType(ResultTypeType newResultType) {
298: ResultTypeType oldResultType = resultType;
299: resultType = newResultType == null ? RESULT_TYPE_EDEFAULT
300: : newResultType;
301: boolean oldResultTypeESet = resultTypeESet;
302: resultTypeESet = true;
303: if (eNotificationRequired())
304: eNotify(new ENotificationImpl(this , Notification.SET,
305: WfsPackage.GET_FEATURE_TYPE__RESULT_TYPE,
306: oldResultType, resultType, !oldResultTypeESet));
307: }
308:
309: /**
310: * <!-- begin-user-doc -->
311: * <!-- end-user-doc -->
312: * @generated
313: */
314: public void unsetResultType() {
315: ResultTypeType oldResultType = resultType;
316: boolean oldResultTypeESet = resultTypeESet;
317: resultType = RESULT_TYPE_EDEFAULT;
318: resultTypeESet = false;
319: if (eNotificationRequired())
320: eNotify(new ENotificationImpl(this , Notification.UNSET,
321: WfsPackage.GET_FEATURE_TYPE__RESULT_TYPE,
322: oldResultType, RESULT_TYPE_EDEFAULT,
323: oldResultTypeESet));
324: }
325:
326: /**
327: * <!-- begin-user-doc -->
328: * <!-- end-user-doc -->
329: * @generated
330: */
331: public boolean isSetResultType() {
332: return resultTypeESet;
333: }
334:
335: /**
336: * <!-- begin-user-doc -->
337: * <!-- end-user-doc -->
338: * @generated
339: */
340: public String getTraverseXlinkDepth() {
341: return traverseXlinkDepth;
342: }
343:
344: /**
345: * <!-- begin-user-doc -->
346: * <!-- end-user-doc -->
347: * @generated
348: */
349: public void setTraverseXlinkDepth(String newTraverseXlinkDepth) {
350: String oldTraverseXlinkDepth = traverseXlinkDepth;
351: traverseXlinkDepth = newTraverseXlinkDepth;
352: if (eNotificationRequired())
353: eNotify(new ENotificationImpl(this , Notification.SET,
354: WfsPackage.GET_FEATURE_TYPE__TRAVERSE_XLINK_DEPTH,
355: oldTraverseXlinkDepth, traverseXlinkDepth));
356: }
357:
358: /**
359: * <!-- begin-user-doc -->
360: * <!-- end-user-doc -->
361: * @generated
362: */
363: public BigInteger getTraverseXlinkExpiry() {
364: return traverseXlinkExpiry;
365: }
366:
367: /**
368: * <!-- begin-user-doc -->
369: * <!-- end-user-doc -->
370: * @generated
371: */
372: public void setTraverseXlinkExpiry(BigInteger newTraverseXlinkExpiry) {
373: BigInteger oldTraverseXlinkExpiry = traverseXlinkExpiry;
374: traverseXlinkExpiry = newTraverseXlinkExpiry;
375: if (eNotificationRequired())
376: eNotify(new ENotificationImpl(this , Notification.SET,
377: WfsPackage.GET_FEATURE_TYPE__TRAVERSE_XLINK_EXPIRY,
378: oldTraverseXlinkExpiry, traverseXlinkExpiry));
379: }
380:
381: /**
382: * <!-- begin-user-doc -->
383: * <!-- end-user-doc -->
384: * @generated
385: */
386: public NotificationChain eInverseRemove(InternalEObject otherEnd,
387: int featureID, NotificationChain msgs) {
388: switch (featureID) {
389: case WfsPackage.GET_FEATURE_TYPE__QUERY:
390: return ((InternalEList) getQuery()).basicRemove(otherEnd,
391: msgs);
392: }
393: return super .eInverseRemove(otherEnd, featureID, msgs);
394: }
395:
396: /**
397: * <!-- begin-user-doc -->
398: * <!-- end-user-doc -->
399: * @generated
400: */
401: public Object eGet(int featureID, boolean resolve, boolean coreType) {
402: switch (featureID) {
403: case WfsPackage.GET_FEATURE_TYPE__QUERY:
404: return getQuery();
405: case WfsPackage.GET_FEATURE_TYPE__MAX_FEATURES:
406: return getMaxFeatures();
407: case WfsPackage.GET_FEATURE_TYPE__OUTPUT_FORMAT:
408: return getOutputFormat();
409: case WfsPackage.GET_FEATURE_TYPE__RESULT_TYPE:
410: return getResultType();
411: case WfsPackage.GET_FEATURE_TYPE__TRAVERSE_XLINK_DEPTH:
412: return getTraverseXlinkDepth();
413: case WfsPackage.GET_FEATURE_TYPE__TRAVERSE_XLINK_EXPIRY:
414: return getTraverseXlinkExpiry();
415: }
416: return super .eGet(featureID, resolve, coreType);
417: }
418:
419: /**
420: * <!-- begin-user-doc -->
421: * <!-- end-user-doc -->
422: * @generated
423: */
424: public void eSet(int featureID, Object newValue) {
425: switch (featureID) {
426: case WfsPackage.GET_FEATURE_TYPE__QUERY:
427: getQuery().clear();
428: getQuery().addAll((Collection) newValue);
429: return;
430: case WfsPackage.GET_FEATURE_TYPE__MAX_FEATURES:
431: setMaxFeatures((BigInteger) newValue);
432: return;
433: case WfsPackage.GET_FEATURE_TYPE__OUTPUT_FORMAT:
434: setOutputFormat((String) newValue);
435: return;
436: case WfsPackage.GET_FEATURE_TYPE__RESULT_TYPE:
437: setResultType((ResultTypeType) newValue);
438: return;
439: case WfsPackage.GET_FEATURE_TYPE__TRAVERSE_XLINK_DEPTH:
440: setTraverseXlinkDepth((String) newValue);
441: return;
442: case WfsPackage.GET_FEATURE_TYPE__TRAVERSE_XLINK_EXPIRY:
443: setTraverseXlinkExpiry((BigInteger) newValue);
444: return;
445: }
446: super .eSet(featureID, newValue);
447: }
448:
449: /**
450: * <!-- begin-user-doc -->
451: * <!-- end-user-doc -->
452: * @generated
453: */
454: public void eUnset(int featureID) {
455: switch (featureID) {
456: case WfsPackage.GET_FEATURE_TYPE__QUERY:
457: getQuery().clear();
458: return;
459: case WfsPackage.GET_FEATURE_TYPE__MAX_FEATURES:
460: setMaxFeatures(MAX_FEATURES_EDEFAULT);
461: return;
462: case WfsPackage.GET_FEATURE_TYPE__OUTPUT_FORMAT:
463: unsetOutputFormat();
464: return;
465: case WfsPackage.GET_FEATURE_TYPE__RESULT_TYPE:
466: unsetResultType();
467: return;
468: case WfsPackage.GET_FEATURE_TYPE__TRAVERSE_XLINK_DEPTH:
469: setTraverseXlinkDepth(TRAVERSE_XLINK_DEPTH_EDEFAULT);
470: return;
471: case WfsPackage.GET_FEATURE_TYPE__TRAVERSE_XLINK_EXPIRY:
472: setTraverseXlinkExpiry(TRAVERSE_XLINK_EXPIRY_EDEFAULT);
473: return;
474: }
475: super .eUnset(featureID);
476: }
477:
478: /**
479: * <!-- begin-user-doc -->
480: * <!-- end-user-doc -->
481: * @generated
482: */
483: public boolean eIsSet(int featureID) {
484: switch (featureID) {
485: case WfsPackage.GET_FEATURE_TYPE__QUERY:
486: return query != null && !query.isEmpty();
487: case WfsPackage.GET_FEATURE_TYPE__MAX_FEATURES:
488: return MAX_FEATURES_EDEFAULT == null ? maxFeatures != null
489: : !MAX_FEATURES_EDEFAULT.equals(maxFeatures);
490: case WfsPackage.GET_FEATURE_TYPE__OUTPUT_FORMAT:
491: return isSetOutputFormat();
492: case WfsPackage.GET_FEATURE_TYPE__RESULT_TYPE:
493: return isSetResultType();
494: case WfsPackage.GET_FEATURE_TYPE__TRAVERSE_XLINK_DEPTH:
495: return TRAVERSE_XLINK_DEPTH_EDEFAULT == null ? traverseXlinkDepth != null
496: : !TRAVERSE_XLINK_DEPTH_EDEFAULT
497: .equals(traverseXlinkDepth);
498: case WfsPackage.GET_FEATURE_TYPE__TRAVERSE_XLINK_EXPIRY:
499: return TRAVERSE_XLINK_EXPIRY_EDEFAULT == null ? traverseXlinkExpiry != null
500: : !TRAVERSE_XLINK_EXPIRY_EDEFAULT
501: .equals(traverseXlinkExpiry);
502: }
503: return super .eIsSet(featureID);
504: }
505:
506: /**
507: * <!-- begin-user-doc -->
508: * <!-- end-user-doc -->
509: * @generated
510: */
511: public String toString() {
512: if (eIsProxy())
513: return super .toString();
514:
515: StringBuffer result = new StringBuffer(super .toString());
516: result.append(" (maxFeatures: ");
517: result.append(maxFeatures);
518: result.append(", outputFormat: ");
519: if (outputFormatESet)
520: result.append(outputFormat);
521: else
522: result.append("<unset>");
523: result.append(", resultType: ");
524: if (resultTypeESet)
525: result.append(resultType);
526: else
527: result.append("<unset>");
528: result.append(", traverseXlinkDepth: ");
529: result.append(traverseXlinkDepth);
530: result.append(", traverseXlinkExpiry: ");
531: result.append(traverseXlinkExpiry);
532: result.append(')');
533: return result.toString();
534: }
535:
536: } //GetFeatureTypeImpl
|