KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > impl > ConstantColumnTypeImpl


1 /**
2  * <copyright>
3  * </copyright>
4  *
5  * $Id$
6  */

7 package Olj.impl;
8
9 import Olj.ConstantColumnType;
10 import Olj.OljPackage;
11 import Olj.ValueModeType6;
12
13 import org.eclipse.emf.common.notify.Notification;
14
15 import org.eclipse.emf.ecore.EClass;
16 import org.eclipse.emf.ecore.EStructuralFeature;
17
18 import org.eclipse.emf.ecore.impl.ENotificationImpl;
19 import org.eclipse.emf.ecore.impl.EObjectImpl;
20
21 /**
22  * <!-- begin-user-doc -->
23  * An implementation of the model object '<em><b>Constant Column Type</b></em>'.
24  * <!-- end-user-doc -->
25  * <p>
26  * The following features are implemented:
27  * <ul>
28  * <li>{@link Olj.impl.ConstantColumnTypeImpl#getConstantValue <em>Constant Value</em>}</li>
29  * <li>{@link Olj.impl.ConstantColumnTypeImpl#getTargetColumnName <em>Target Column Name</em>}</li>
30  * <li>{@link Olj.impl.ConstantColumnTypeImpl#getTargetTableID <em>Target Table ID</em>}</li>
31  * <li>{@link Olj.impl.ConstantColumnTypeImpl#getTargetTableName <em>Target Table Name</em>}</li>
32  * <li>{@link Olj.impl.ConstantColumnTypeImpl#getValueMode <em>Value Mode</em>}</li>
33  * </ul>
34  * </p>
35  *
36  * @generated
37  */

38 public class ConstantColumnTypeImpl extends EObjectImpl implements ConstantColumnType {
39     /**
40      * The default value of the '{@link #getConstantValue() <em>Constant Value</em>}' attribute.
41      * <!-- begin-user-doc -->
42      * <!-- end-user-doc -->
43      * @see #getConstantValue()
44      * @generated
45      * @ordered
46      */

47     protected static final String JavaDoc CONSTANT_VALUE_EDEFAULT = null;
48
49     /**
50      * The cached value of the '{@link #getConstantValue() <em>Constant Value</em>}' attribute.
51      * <!-- begin-user-doc -->
52      * <!-- end-user-doc -->
53      * @see #getConstantValue()
54      * @generated
55      * @ordered
56      */

57     protected String JavaDoc constantValue = CONSTANT_VALUE_EDEFAULT;
58
59     /**
60      * The default value of the '{@link #getTargetColumnName() <em>Target Column Name</em>}' attribute.
61      * <!-- begin-user-doc -->
62      * <!-- end-user-doc -->
63      * @see #getTargetColumnName()
64      * @generated
65      * @ordered
66      */

67     protected static final String JavaDoc TARGET_COLUMN_NAME_EDEFAULT = null;
68
69     /**
70      * The cached value of the '{@link #getTargetColumnName() <em>Target Column Name</em>}' attribute.
71      * <!-- begin-user-doc -->
72      * <!-- end-user-doc -->
73      * @see #getTargetColumnName()
74      * @generated
75      * @ordered
76      */

77     protected String JavaDoc targetColumnName = TARGET_COLUMN_NAME_EDEFAULT;
78
79     /**
80      * The default value of the '{@link #getTargetTableID() <em>Target Table ID</em>}' attribute.
81      * <!-- begin-user-doc -->
82      * <!-- end-user-doc -->
83      * @see #getTargetTableID()
84      * @generated
85      * @ordered
86      */

87     protected static final String JavaDoc TARGET_TABLE_ID_EDEFAULT = null;
88
89     /**
90      * The cached value of the '{@link #getTargetTableID() <em>Target Table ID</em>}' attribute.
91      * <!-- begin-user-doc -->
92      * <!-- end-user-doc -->
93      * @see #getTargetTableID()
94      * @generated
95      * @ordered
96      */

97     protected String JavaDoc targetTableID = TARGET_TABLE_ID_EDEFAULT;
98
99     /**
100      * The default value of the '{@link #getTargetTableName() <em>Target Table Name</em>}' attribute.
101      * <!-- begin-user-doc -->
102      * <!-- end-user-doc -->
103      * @see #getTargetTableName()
104      * @generated
105      * @ordered
106      */

107     protected static final String JavaDoc TARGET_TABLE_NAME_EDEFAULT = null;
108
109     /**
110      * The cached value of the '{@link #getTargetTableName() <em>Target Table Name</em>}' attribute.
111      * <!-- begin-user-doc -->
112      * <!-- end-user-doc -->
113      * @see #getTargetTableName()
114      * @generated
115      * @ordered
116      */

117     protected String JavaDoc targetTableName = TARGET_TABLE_NAME_EDEFAULT;
118
119     /**
120      * The default value of the '{@link #getValueMode() <em>Value Mode</em>}' attribute.
121      * <!-- begin-user-doc -->
122      * <!-- end-user-doc -->
123      * @see #getValueMode()
124      * @generated
125      * @ordered
126      */

127     protected static final ValueModeType6 VALUE_MODE_EDEFAULT = ValueModeType6.KEY_LITERAL;
128
129     /**
130      * The cached value of the '{@link #getValueMode() <em>Value Mode</em>}' attribute.
131      * <!-- begin-user-doc -->
132      * <!-- end-user-doc -->
133      * @see #getValueMode()
134      * @generated
135      * @ordered
136      */

137     protected ValueModeType6 valueMode = VALUE_MODE_EDEFAULT;
138
139     /**
140      * This is true if the Value Mode attribute has been set.
141      * <!-- begin-user-doc -->
142      * <!-- end-user-doc -->
143      * @generated
144      * @ordered
145      */

146     protected boolean valueModeESet = false;
147
148     /**
149      * <!-- begin-user-doc -->
150      * <!-- end-user-doc -->
151      * @generated
152      */

153     protected ConstantColumnTypeImpl() {
154         super();
155     }
156
157     /**
158      * <!-- begin-user-doc -->
159      * <!-- end-user-doc -->
160      * @generated
161      */

162     protected EClass eStaticClass() {
163         return OljPackage.eINSTANCE.getConstantColumnType();
164     }
165
166     /**
167      * <!-- begin-user-doc -->
168      * <!-- end-user-doc -->
169      * @generated
170      */

171     public String JavaDoc getConstantValue() {
172         return constantValue;
173     }
174
175     /**
176      * <!-- begin-user-doc -->
177      * <!-- end-user-doc -->
178      * @generated
179      */

180     public void setConstantValue(String JavaDoc newConstantValue) {
181         String JavaDoc oldConstantValue = constantValue;
182         constantValue = newConstantValue;
183         if (eNotificationRequired())
184             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.CONSTANT_COLUMN_TYPE__CONSTANT_VALUE, oldConstantValue, constantValue));
185     }
186
187     /**
188      * <!-- begin-user-doc -->
189      * <!-- end-user-doc -->
190      * @generated
191      */

192     public String JavaDoc getTargetColumnName() {
193         return targetColumnName;
194     }
195
196     /**
197      * <!-- begin-user-doc -->
198      * <!-- end-user-doc -->
199      * @generated
200      */

201     public void setTargetColumnName(String JavaDoc newTargetColumnName) {
202         String JavaDoc oldTargetColumnName = targetColumnName;
203         targetColumnName = newTargetColumnName;
204         if (eNotificationRequired())
205             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.CONSTANT_COLUMN_TYPE__TARGET_COLUMN_NAME, oldTargetColumnName, targetColumnName));
206     }
207
208     /**
209      * <!-- begin-user-doc -->
210      * <!-- end-user-doc -->
211      * @generated
212      */

213     public String JavaDoc getTargetTableID() {
214         return targetTableID;
215     }
216
217     /**
218      * <!-- begin-user-doc -->
219      * <!-- end-user-doc -->
220      * @generated
221      */

222     public void setTargetTableID(String JavaDoc newTargetTableID) {
223         String JavaDoc oldTargetTableID = targetTableID;
224         targetTableID = newTargetTableID;
225         if (eNotificationRequired())
226             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.CONSTANT_COLUMN_TYPE__TARGET_TABLE_ID, oldTargetTableID, targetTableID));
227     }
228
229     /**
230      * <!-- begin-user-doc -->
231      * <!-- end-user-doc -->
232      * @generated
233      */

234     public String JavaDoc getTargetTableName() {
235         return targetTableName;
236     }
237
238     /**
239      * <!-- begin-user-doc -->
240      * <!-- end-user-doc -->
241      * @generated
242      */

243     public void setTargetTableName(String JavaDoc newTargetTableName) {
244         String JavaDoc oldTargetTableName = targetTableName;
245         targetTableName = newTargetTableName;
246         if (eNotificationRequired())
247             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.CONSTANT_COLUMN_TYPE__TARGET_TABLE_NAME, oldTargetTableName, targetTableName));
248     }
249
250     /**
251      * <!-- begin-user-doc -->
252      * <!-- end-user-doc -->
253      * @generated
254      */

255     public ValueModeType6 getValueMode() {
256         return valueMode;
257     }
258
259     /**
260      * <!-- begin-user-doc -->
261      * <!-- end-user-doc -->
262      * @generated
263      */

264     public void setValueMode(ValueModeType6 newValueMode) {
265         ValueModeType6 oldValueMode = valueMode;
266         valueMode = newValueMode == null ? VALUE_MODE_EDEFAULT : newValueMode;
267         boolean oldValueModeESet = valueModeESet;
268         valueModeESet = true;
269         if (eNotificationRequired())
270             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.CONSTANT_COLUMN_TYPE__VALUE_MODE, oldValueMode, valueMode, !oldValueModeESet));
271     }
272
273     /**
274      * <!-- begin-user-doc -->
275      * <!-- end-user-doc -->
276      * @generated
277      */

278     public void unsetValueMode() {
279         ValueModeType6 oldValueMode = valueMode;
280         boolean oldValueModeESet = valueModeESet;
281         valueMode = VALUE_MODE_EDEFAULT;
282         valueModeESet = false;
283         if (eNotificationRequired())
284             eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.CONSTANT_COLUMN_TYPE__VALUE_MODE, oldValueMode, VALUE_MODE_EDEFAULT, oldValueModeESet));
285     }
286
287     /**
288      * <!-- begin-user-doc -->
289      * <!-- end-user-doc -->
290      * @generated
291      */

292     public boolean isSetValueMode() {
293         return valueModeESet;
294     }
295
296     /**
297      * <!-- begin-user-doc -->
298      * <!-- end-user-doc -->
299      * @generated
300      */

301     public Object JavaDoc eGet(EStructuralFeature eFeature, boolean resolve) {
302         switch (eDerivedStructuralFeatureID(eFeature)) {
303             case OljPackage.CONSTANT_COLUMN_TYPE__CONSTANT_VALUE:
304                 return getConstantValue();
305             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_COLUMN_NAME:
306                 return getTargetColumnName();
307             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_TABLE_ID:
308                 return getTargetTableID();
309             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_TABLE_NAME:
310                 return getTargetTableName();
311             case OljPackage.CONSTANT_COLUMN_TYPE__VALUE_MODE:
312                 return getValueMode();
313         }
314         return eDynamicGet(eFeature, resolve);
315     }
316
317     /**
318      * <!-- begin-user-doc -->
319      * <!-- end-user-doc -->
320      * @generated
321      */

322     public void eSet(EStructuralFeature eFeature, Object JavaDoc newValue) {
323         switch (eDerivedStructuralFeatureID(eFeature)) {
324             case OljPackage.CONSTANT_COLUMN_TYPE__CONSTANT_VALUE:
325                 setConstantValue((String JavaDoc)newValue);
326                 return;
327             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_COLUMN_NAME:
328                 setTargetColumnName((String JavaDoc)newValue);
329                 return;
330             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_TABLE_ID:
331                 setTargetTableID((String JavaDoc)newValue);
332                 return;
333             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_TABLE_NAME:
334                 setTargetTableName((String JavaDoc)newValue);
335                 return;
336             case OljPackage.CONSTANT_COLUMN_TYPE__VALUE_MODE:
337                 setValueMode((ValueModeType6)newValue);
338                 return;
339         }
340         eDynamicSet(eFeature, newValue);
341     }
342
343     /**
344      * <!-- begin-user-doc -->
345      * <!-- end-user-doc -->
346      * @generated
347      */

348     public void eUnset(EStructuralFeature eFeature) {
349         switch (eDerivedStructuralFeatureID(eFeature)) {
350             case OljPackage.CONSTANT_COLUMN_TYPE__CONSTANT_VALUE:
351                 setConstantValue(CONSTANT_VALUE_EDEFAULT);
352                 return;
353             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_COLUMN_NAME:
354                 setTargetColumnName(TARGET_COLUMN_NAME_EDEFAULT);
355                 return;
356             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_TABLE_ID:
357                 setTargetTableID(TARGET_TABLE_ID_EDEFAULT);
358                 return;
359             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_TABLE_NAME:
360                 setTargetTableName(TARGET_TABLE_NAME_EDEFAULT);
361                 return;
362             case OljPackage.CONSTANT_COLUMN_TYPE__VALUE_MODE:
363                 unsetValueMode();
364                 return;
365         }
366         eDynamicUnset(eFeature);
367     }
368
369     /**
370      * <!-- begin-user-doc -->
371      * <!-- end-user-doc -->
372      * @generated
373      */

374     public boolean eIsSet(EStructuralFeature eFeature) {
375         switch (eDerivedStructuralFeatureID(eFeature)) {
376             case OljPackage.CONSTANT_COLUMN_TYPE__CONSTANT_VALUE:
377                 return CONSTANT_VALUE_EDEFAULT == null ? constantValue != null : !CONSTANT_VALUE_EDEFAULT.equals(constantValue);
378             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_COLUMN_NAME:
379                 return TARGET_COLUMN_NAME_EDEFAULT == null ? targetColumnName != null : !TARGET_COLUMN_NAME_EDEFAULT.equals(targetColumnName);
380             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_TABLE_ID:
381                 return TARGET_TABLE_ID_EDEFAULT == null ? targetTableID != null : !TARGET_TABLE_ID_EDEFAULT.equals(targetTableID);
382             case OljPackage.CONSTANT_COLUMN_TYPE__TARGET_TABLE_NAME:
383                 return TARGET_TABLE_NAME_EDEFAULT == null ? targetTableName != null : !TARGET_TABLE_NAME_EDEFAULT.equals(targetTableName);
384             case OljPackage.CONSTANT_COLUMN_TYPE__VALUE_MODE:
385                 return isSetValueMode();
386         }
387         return eDynamicIsSet(eFeature);
388     }
389
390     /**
391      * <!-- begin-user-doc -->
392      * <!-- end-user-doc -->
393      * @generated
394      */

395     public String JavaDoc toString() {
396         if (eIsProxy()) return super.toString();
397
398         StringBuffer JavaDoc result = new StringBuffer JavaDoc(super.toString());
399         result.append(" (constantValue: ");
400         result.append(constantValue);
401         result.append(", targetColumnName: ");
402         result.append(targetColumnName);
403         result.append(", targetTableID: ");
404         result.append(targetTableID);
405         result.append(", targetTableName: ");
406         result.append(targetTableName);
407         result.append(", valueMode: ");
408         if (valueModeESet) result.append(valueMode); else result.append("<unset>");
409         result.append(')');
410         return result.toString();
411     }
412
413 } //ConstantColumnTypeImpl
414
Popular Tags