001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: CodeTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.ows.impl;
007:
008: import net.opengis.ows.CodeType;
009: import net.opengis.ows.OwsPackage;
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>Code Type</b></em>'.
021: * <!-- end-user-doc -->
022: * <p>
023: * The following features are implemented:
024: * <ul>
025: * <li>{@link net.opengis.ows.impl.CodeTypeImpl#getValue <em>Value</em>}</li>
026: * <li>{@link net.opengis.ows.impl.CodeTypeImpl#getCodeSpace <em>Code Space</em>}</li>
027: * </ul>
028: * </p>
029: *
030: * @generated
031: */
032: public class CodeTypeImpl extends EObjectImpl implements CodeType {
033: /**
034: * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
035: * <!-- begin-user-doc -->
036: * <!-- end-user-doc -->
037: * @see #getValue()
038: * @generated
039: * @ordered
040: */
041: protected static final String VALUE_EDEFAULT = null;
042:
043: /**
044: * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
045: * <!-- begin-user-doc -->
046: * <!-- end-user-doc -->
047: * @see #getValue()
048: * @generated
049: * @ordered
050: */
051: protected String value = VALUE_EDEFAULT;
052:
053: /**
054: * The default value of the '{@link #getCodeSpace() <em>Code Space</em>}' attribute.
055: * <!-- begin-user-doc -->
056: * <!-- end-user-doc -->
057: * @see #getCodeSpace()
058: * @generated
059: * @ordered
060: */
061: protected static final String CODE_SPACE_EDEFAULT = null;
062:
063: /**
064: * The cached value of the '{@link #getCodeSpace() <em>Code Space</em>}' attribute.
065: * <!-- begin-user-doc -->
066: * <!-- end-user-doc -->
067: * @see #getCodeSpace()
068: * @generated
069: * @ordered
070: */
071: protected String codeSpace = CODE_SPACE_EDEFAULT;
072:
073: /**
074: * <!-- begin-user-doc -->
075: * <!-- end-user-doc -->
076: * @generated
077: */
078: protected CodeTypeImpl() {
079: super ();
080: }
081:
082: /**
083: * <!-- begin-user-doc -->
084: * <!-- end-user-doc -->
085: * @generated
086: */
087: protected EClass eStaticClass() {
088: return OwsPackage.Literals.CODE_TYPE;
089: }
090:
091: /**
092: * <!-- begin-user-doc -->
093: * <!-- end-user-doc -->
094: * @generated
095: */
096: public String getValue() {
097: return value;
098: }
099:
100: /**
101: * <!-- begin-user-doc -->
102: * <!-- end-user-doc -->
103: * @generated
104: */
105: public void setValue(String newValue) {
106: String oldValue = value;
107: value = newValue;
108: if (eNotificationRequired())
109: eNotify(new ENotificationImpl(this , Notification.SET,
110: OwsPackage.CODE_TYPE__VALUE, oldValue, value));
111: }
112:
113: /**
114: * <!-- begin-user-doc -->
115: * <!-- end-user-doc -->
116: * @generated
117: */
118: public String getCodeSpace() {
119: return codeSpace;
120: }
121:
122: /**
123: * <!-- begin-user-doc -->
124: * <!-- end-user-doc -->
125: * @generated
126: */
127: public void setCodeSpace(String newCodeSpace) {
128: String oldCodeSpace = codeSpace;
129: codeSpace = newCodeSpace;
130: if (eNotificationRequired())
131: eNotify(new ENotificationImpl(this , Notification.SET,
132: OwsPackage.CODE_TYPE__CODE_SPACE, oldCodeSpace,
133: codeSpace));
134: }
135:
136: /**
137: * <!-- begin-user-doc -->
138: * <!-- end-user-doc -->
139: * @generated
140: */
141: public Object eGet(int featureID, boolean resolve, boolean coreType) {
142: switch (featureID) {
143: case OwsPackage.CODE_TYPE__VALUE:
144: return getValue();
145: case OwsPackage.CODE_TYPE__CODE_SPACE:
146: return getCodeSpace();
147: }
148: return super .eGet(featureID, resolve, coreType);
149: }
150:
151: /**
152: * <!-- begin-user-doc -->
153: * <!-- end-user-doc -->
154: * @generated
155: */
156: public void eSet(int featureID, Object newValue) {
157: switch (featureID) {
158: case OwsPackage.CODE_TYPE__VALUE:
159: setValue((String) newValue);
160: return;
161: case OwsPackage.CODE_TYPE__CODE_SPACE:
162: setCodeSpace((String) newValue);
163: return;
164: }
165: super .eSet(featureID, newValue);
166: }
167:
168: /**
169: * <!-- begin-user-doc -->
170: * <!-- end-user-doc -->
171: * @generated
172: */
173: public void eUnset(int featureID) {
174: switch (featureID) {
175: case OwsPackage.CODE_TYPE__VALUE:
176: setValue(VALUE_EDEFAULT);
177: return;
178: case OwsPackage.CODE_TYPE__CODE_SPACE:
179: setCodeSpace(CODE_SPACE_EDEFAULT);
180: return;
181: }
182: super .eUnset(featureID);
183: }
184:
185: /**
186: * <!-- begin-user-doc -->
187: * <!-- end-user-doc -->
188: * @generated
189: */
190: public boolean eIsSet(int featureID) {
191: switch (featureID) {
192: case OwsPackage.CODE_TYPE__VALUE:
193: return VALUE_EDEFAULT == null ? value != null
194: : !VALUE_EDEFAULT.equals(value);
195: case OwsPackage.CODE_TYPE__CODE_SPACE:
196: return CODE_SPACE_EDEFAULT == null ? codeSpace != null
197: : !CODE_SPACE_EDEFAULT.equals(codeSpace);
198: }
199: return super .eIsSet(featureID);
200: }
201:
202: /**
203: * <!-- begin-user-doc -->
204: * <!-- end-user-doc -->
205: * @generated
206: */
207: public String toString() {
208: if (eIsProxy())
209: return super .toString();
210:
211: StringBuffer result = new StringBuffer(super .toString());
212: result.append(" (value: ");
213: result.append(value);
214: result.append(", codeSpace: ");
215: result.append(codeSpace);
216: result.append(')');
217: return result.toString();
218: }
219:
220: } //CodeTypeImpl
|