001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: NativeTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.wfs.impl;
007:
008: import net.opengis.wfs.NativeType;
009: import net.opengis.wfs.WfsPackage;
010:
011: import org.eclipse.emf.common.notify.Notification;
012:
013: import org.eclipse.emf.ecore.EClass;
014:
015: import org.eclipse.emf.ecore.impl.ENotificationImpl;
016: import org.eclipse.emf.ecore.impl.EObjectImpl;
017:
018: /**
019: * <!-- begin-user-doc -->
020: * An implementation of the model object '<em><b>Native Type</b></em>'.
021: * <!-- end-user-doc -->
022: * <p>
023: * The following features are implemented:
024: * <ul>
025: * <li>{@link net.opengis.wfs.impl.NativeTypeImpl#isSafeToIgnore <em>Safe To Ignore</em>}</li>
026: * <li>{@link net.opengis.wfs.impl.NativeTypeImpl#getVendorId <em>Vendor Id</em>}</li>
027: * </ul>
028: * </p>
029: *
030: * @generated
031: */
032: public class NativeTypeImpl extends EObjectImpl implements NativeType {
033: /**
034: * The default value of the '{@link #isSafeToIgnore() <em>Safe To Ignore</em>}' attribute.
035: * <!-- begin-user-doc -->
036: * <!-- end-user-doc -->
037: * @see #isSafeToIgnore()
038: * @generated
039: * @ordered
040: */
041: protected static final boolean SAFE_TO_IGNORE_EDEFAULT = false;
042:
043: /**
044: * The cached value of the '{@link #isSafeToIgnore() <em>Safe To Ignore</em>}' attribute.
045: * <!-- begin-user-doc -->
046: * <!-- end-user-doc -->
047: * @see #isSafeToIgnore()
048: * @generated
049: * @ordered
050: */
051: protected boolean safeToIgnore = SAFE_TO_IGNORE_EDEFAULT;
052:
053: /**
054: * This is true if the Safe To Ignore attribute has been set.
055: * <!-- begin-user-doc -->
056: * <!-- end-user-doc -->
057: * @generated
058: * @ordered
059: */
060: protected boolean safeToIgnoreESet;
061:
062: /**
063: * The default value of the '{@link #getVendorId() <em>Vendor Id</em>}' attribute.
064: * <!-- begin-user-doc -->
065: * <!-- end-user-doc -->
066: * @see #getVendorId()
067: * @generated
068: * @ordered
069: */
070: protected static final String VENDOR_ID_EDEFAULT = null;
071:
072: /**
073: * The cached value of the '{@link #getVendorId() <em>Vendor Id</em>}' attribute.
074: * <!-- begin-user-doc -->
075: * <!-- end-user-doc -->
076: * @see #getVendorId()
077: * @generated
078: * @ordered
079: */
080: protected String vendorId = VENDOR_ID_EDEFAULT;
081:
082: /**
083: * <!-- begin-user-doc -->
084: * <!-- end-user-doc -->
085: * @generated
086: */
087: protected NativeTypeImpl() {
088: super ();
089: }
090:
091: /**
092: * <!-- begin-user-doc -->
093: * <!-- end-user-doc -->
094: * @generated
095: */
096: protected EClass eStaticClass() {
097: return WfsPackage.Literals.NATIVE_TYPE;
098: }
099:
100: /**
101: * <!-- begin-user-doc -->
102: * <!-- end-user-doc -->
103: * @generated
104: */
105: public boolean isSafeToIgnore() {
106: return safeToIgnore;
107: }
108:
109: /**
110: * <!-- begin-user-doc -->
111: * <!-- end-user-doc -->
112: * @generated
113: */
114: public void setSafeToIgnore(boolean newSafeToIgnore) {
115: boolean oldSafeToIgnore = safeToIgnore;
116: safeToIgnore = newSafeToIgnore;
117: boolean oldSafeToIgnoreESet = safeToIgnoreESet;
118: safeToIgnoreESet = true;
119: if (eNotificationRequired())
120: eNotify(new ENotificationImpl(this , Notification.SET,
121: WfsPackage.NATIVE_TYPE__SAFE_TO_IGNORE,
122: oldSafeToIgnore, safeToIgnore, !oldSafeToIgnoreESet));
123: }
124:
125: /**
126: * <!-- begin-user-doc -->
127: * <!-- end-user-doc -->
128: * @generated
129: */
130: public void unsetSafeToIgnore() {
131: boolean oldSafeToIgnore = safeToIgnore;
132: boolean oldSafeToIgnoreESet = safeToIgnoreESet;
133: safeToIgnore = SAFE_TO_IGNORE_EDEFAULT;
134: safeToIgnoreESet = false;
135: if (eNotificationRequired())
136: eNotify(new ENotificationImpl(this , Notification.UNSET,
137: WfsPackage.NATIVE_TYPE__SAFE_TO_IGNORE,
138: oldSafeToIgnore, SAFE_TO_IGNORE_EDEFAULT,
139: oldSafeToIgnoreESet));
140: }
141:
142: /**
143: * <!-- begin-user-doc -->
144: * <!-- end-user-doc -->
145: * @generated
146: */
147: public boolean isSetSafeToIgnore() {
148: return safeToIgnoreESet;
149: }
150:
151: /**
152: * <!-- begin-user-doc -->
153: * <!-- end-user-doc -->
154: * @generated
155: */
156: public String getVendorId() {
157: return vendorId;
158: }
159:
160: /**
161: * <!-- begin-user-doc -->
162: * <!-- end-user-doc -->
163: * @generated
164: */
165: public void setVendorId(String newVendorId) {
166: String oldVendorId = vendorId;
167: vendorId = newVendorId;
168: if (eNotificationRequired())
169: eNotify(new ENotificationImpl(this , Notification.SET,
170: WfsPackage.NATIVE_TYPE__VENDOR_ID, oldVendorId,
171: vendorId));
172: }
173:
174: /**
175: * <!-- begin-user-doc -->
176: * <!-- end-user-doc -->
177: * @generated
178: */
179: public Object eGet(int featureID, boolean resolve, boolean coreType) {
180: switch (featureID) {
181: case WfsPackage.NATIVE_TYPE__SAFE_TO_IGNORE:
182: return isSafeToIgnore() ? Boolean.TRUE : Boolean.FALSE;
183: case WfsPackage.NATIVE_TYPE__VENDOR_ID:
184: return getVendorId();
185: }
186: return super .eGet(featureID, resolve, coreType);
187: }
188:
189: /**
190: * <!-- begin-user-doc -->
191: * <!-- end-user-doc -->
192: * @generated
193: */
194: public void eSet(int featureID, Object newValue) {
195: switch (featureID) {
196: case WfsPackage.NATIVE_TYPE__SAFE_TO_IGNORE:
197: setSafeToIgnore(((Boolean) newValue).booleanValue());
198: return;
199: case WfsPackage.NATIVE_TYPE__VENDOR_ID:
200: setVendorId((String) newValue);
201: return;
202: }
203: super .eSet(featureID, newValue);
204: }
205:
206: /**
207: * <!-- begin-user-doc -->
208: * <!-- end-user-doc -->
209: * @generated
210: */
211: public void eUnset(int featureID) {
212: switch (featureID) {
213: case WfsPackage.NATIVE_TYPE__SAFE_TO_IGNORE:
214: unsetSafeToIgnore();
215: return;
216: case WfsPackage.NATIVE_TYPE__VENDOR_ID:
217: setVendorId(VENDOR_ID_EDEFAULT);
218: return;
219: }
220: super .eUnset(featureID);
221: }
222:
223: /**
224: * <!-- begin-user-doc -->
225: * <!-- end-user-doc -->
226: * @generated
227: */
228: public boolean eIsSet(int featureID) {
229: switch (featureID) {
230: case WfsPackage.NATIVE_TYPE__SAFE_TO_IGNORE:
231: return isSetSafeToIgnore();
232: case WfsPackage.NATIVE_TYPE__VENDOR_ID:
233: return VENDOR_ID_EDEFAULT == null ? vendorId != null
234: : !VENDOR_ID_EDEFAULT.equals(vendorId);
235: }
236: return super .eIsSet(featureID);
237: }
238:
239: /**
240: * <!-- begin-user-doc -->
241: * <!-- end-user-doc -->
242: * @generated
243: */
244: public String toString() {
245: if (eIsProxy())
246: return super .toString();
247:
248: StringBuffer result = new StringBuffer(super .toString());
249: result.append(" (safeToIgnore: ");
250: if (safeToIgnoreESet)
251: result.append(safeToIgnore);
252: else
253: result.append("<unset>");
254: result.append(", vendorId: ");
255: result.append(vendorId);
256: result.append(')');
257: return result.toString();
258: }
259:
260: } //NativeTypeImpl
|