KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > impl > UserIDColumnTypeImpl


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

7 package Olj.impl;
8
9 import Olj.OljPackage;
10 import Olj.UserIDColumnType;
11 import Olj.ValueModeType3;
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>User ID Column Type</b></em>'.
24  * <!-- end-user-doc -->
25  * <p>
26  * The following features are implemented:
27  * <ul>
28  * <li>{@link Olj.impl.UserIDColumnTypeImpl#getDefaultValue <em>Default Value</em>}</li>
29  * <li>{@link Olj.impl.UserIDColumnTypeImpl#getName <em>Name</em>}</li>
30  * <li>{@link Olj.impl.UserIDColumnTypeImpl#getTargetColumnName <em>Target Column Name</em>}</li>
31  * <li>{@link Olj.impl.UserIDColumnTypeImpl#getTargetTableID <em>Target Table ID</em>}</li>
32  * <li>{@link Olj.impl.UserIDColumnTypeImpl#getTargetTableName <em>Target Table Name</em>}</li>
33  * <li>{@link Olj.impl.UserIDColumnTypeImpl#getValueMode <em>Value Mode</em>}</li>
34  * </ul>
35  * </p>
36  *
37  * @generated
38  */

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

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

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

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

78     protected String JavaDoc name = NAME_EDEFAULT;
79
80     /**
81      * The default value of the '{@link #getTargetColumnName() <em>Target Column Name</em>}' attribute.
82      * <!-- begin-user-doc -->
83      * <!-- end-user-doc -->
84      * @see #getTargetColumnName()
85      * @generated
86      * @ordered
87      */

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

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

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

118     protected String JavaDoc targetTableID = TARGET_TABLE_ID_EDEFAULT;
119
120     /**
121      * The default value of the '{@link #getTargetTableName() <em>Target Table Name</em>}' attribute.
122      * <!-- begin-user-doc -->
123      * <!-- end-user-doc -->
124      * @see #getTargetTableName()
125      * @generated
126      * @ordered
127      */

128     protected static final String JavaDoc TARGET_TABLE_NAME_EDEFAULT = null;
129
130     /**
131      * The cached value of the '{@link #getTargetTableName() <em>Target Table Name</em>}' attribute.
132      * <!-- begin-user-doc -->
133      * <!-- end-user-doc -->
134      * @see #getTargetTableName()
135      * @generated
136      * @ordered
137      */

138     protected String JavaDoc targetTableName = TARGET_TABLE_NAME_EDEFAULT;
139
140     /**
141      * The default value of the '{@link #getValueMode() <em>Value Mode</em>}' attribute.
142      * <!-- begin-user-doc -->
143      * <!-- end-user-doc -->
144      * @see #getValueMode()
145      * @generated
146      * @ordered
147      */

148     protected static final ValueModeType3 VALUE_MODE_EDEFAULT = ValueModeType3.KEY_LITERAL;
149
150     /**
151      * The cached value of the '{@link #getValueMode() <em>Value Mode</em>}' attribute.
152      * <!-- begin-user-doc -->
153      * <!-- end-user-doc -->
154      * @see #getValueMode()
155      * @generated
156      * @ordered
157      */

158     protected ValueModeType3 valueMode = VALUE_MODE_EDEFAULT;
159
160     /**
161      * This is true if the Value Mode attribute has been set.
162      * <!-- begin-user-doc -->
163      * <!-- end-user-doc -->
164      * @generated
165      * @ordered
166      */

167     protected boolean valueModeESet = false;
168
169     /**
170      * <!-- begin-user-doc -->
171      * <!-- end-user-doc -->
172      * @generated
173      */

174     protected UserIDColumnTypeImpl() {
175         super();
176     }
177
178     /**
179      * <!-- begin-user-doc -->
180      * <!-- end-user-doc -->
181      * @generated
182      */

183     protected EClass eStaticClass() {
184         return OljPackage.eINSTANCE.getUserIDColumnType();
185     }
186
187     /**
188      * <!-- begin-user-doc -->
189      * <!-- end-user-doc -->
190      * @generated
191      */

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

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

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

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

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

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

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

264     public void setTargetTableID(String JavaDoc newTargetTableID) {
265         String JavaDoc oldTargetTableID = targetTableID;
266         targetTableID = newTargetTableID;
267         if (eNotificationRequired())
268             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.USER_ID_COLUMN_TYPE__TARGET_TABLE_ID, oldTargetTableID, targetTableID));
269     }
270
271     /**
272      * <!-- begin-user-doc -->
273      * <!-- end-user-doc -->
274      * @generated
275      */

276     public String JavaDoc getTargetTableName() {
277         return targetTableName;
278     }
279
280     /**
281      * <!-- begin-user-doc -->
282      * <!-- end-user-doc -->
283      * @generated
284      */

285     public void setTargetTableName(String JavaDoc newTargetTableName) {
286         String JavaDoc oldTargetTableName = targetTableName;
287         targetTableName = newTargetTableName;
288         if (eNotificationRequired())
289             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.USER_ID_COLUMN_TYPE__TARGET_TABLE_NAME, oldTargetTableName, targetTableName));
290     }
291
292     /**
293      * <!-- begin-user-doc -->
294      * <!-- end-user-doc -->
295      * @generated
296      */

297     public ValueModeType3 getValueMode() {
298         return valueMode;
299     }
300
301     /**
302      * <!-- begin-user-doc -->
303      * <!-- end-user-doc -->
304      * @generated
305      */

306     public void setValueMode(ValueModeType3 newValueMode) {
307         ValueModeType3 oldValueMode = valueMode;
308         valueMode = newValueMode == null ? VALUE_MODE_EDEFAULT : newValueMode;
309         boolean oldValueModeESet = valueModeESet;
310         valueModeESet = true;
311         if (eNotificationRequired())
312             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.USER_ID_COLUMN_TYPE__VALUE_MODE, oldValueMode, valueMode, !oldValueModeESet));
313     }
314
315     /**
316      * <!-- begin-user-doc -->
317      * <!-- end-user-doc -->
318      * @generated
319      */

320     public void unsetValueMode() {
321         ValueModeType3 oldValueMode = valueMode;
322         boolean oldValueModeESet = valueModeESet;
323         valueMode = VALUE_MODE_EDEFAULT;
324         valueModeESet = false;
325         if (eNotificationRequired())
326             eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.USER_ID_COLUMN_TYPE__VALUE_MODE, oldValueMode, VALUE_MODE_EDEFAULT, oldValueModeESet));
327     }
328
329     /**
330      * <!-- begin-user-doc -->
331      * <!-- end-user-doc -->
332      * @generated
333      */

334     public boolean isSetValueMode() {
335         return valueModeESet;
336     }
337
338     /**
339      * <!-- begin-user-doc -->
340      * <!-- end-user-doc -->
341      * @generated
342      */

343     public Object JavaDoc eGet(EStructuralFeature eFeature, boolean resolve) {
344         switch (eDerivedStructuralFeatureID(eFeature)) {
345             case OljPackage.USER_ID_COLUMN_TYPE__DEFAULT_VALUE:
346                 return getDefaultValue();
347             case OljPackage.USER_ID_COLUMN_TYPE__NAME:
348                 return getName();
349             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_COLUMN_NAME:
350                 return getTargetColumnName();
351             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_TABLE_ID:
352                 return getTargetTableID();
353             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_TABLE_NAME:
354                 return getTargetTableName();
355             case OljPackage.USER_ID_COLUMN_TYPE__VALUE_MODE:
356                 return getValueMode();
357         }
358         return eDynamicGet(eFeature, resolve);
359     }
360
361     /**
362      * <!-- begin-user-doc -->
363      * <!-- end-user-doc -->
364      * @generated
365      */

366     public void eSet(EStructuralFeature eFeature, Object JavaDoc newValue) {
367         switch (eDerivedStructuralFeatureID(eFeature)) {
368             case OljPackage.USER_ID_COLUMN_TYPE__DEFAULT_VALUE:
369                 setDefaultValue((String JavaDoc)newValue);
370                 return;
371             case OljPackage.USER_ID_COLUMN_TYPE__NAME:
372                 setName((String JavaDoc)newValue);
373                 return;
374             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_COLUMN_NAME:
375                 setTargetColumnName((String JavaDoc)newValue);
376                 return;
377             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_TABLE_ID:
378                 setTargetTableID((String JavaDoc)newValue);
379                 return;
380             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_TABLE_NAME:
381                 setTargetTableName((String JavaDoc)newValue);
382                 return;
383             case OljPackage.USER_ID_COLUMN_TYPE__VALUE_MODE:
384                 setValueMode((ValueModeType3)newValue);
385                 return;
386         }
387         eDynamicSet(eFeature, newValue);
388     }
389
390     /**
391      * <!-- begin-user-doc -->
392      * <!-- end-user-doc -->
393      * @generated
394      */

395     public void eUnset(EStructuralFeature eFeature) {
396         switch (eDerivedStructuralFeatureID(eFeature)) {
397             case OljPackage.USER_ID_COLUMN_TYPE__DEFAULT_VALUE:
398                 setDefaultValue(DEFAULT_VALUE_EDEFAULT);
399                 return;
400             case OljPackage.USER_ID_COLUMN_TYPE__NAME:
401                 setName(NAME_EDEFAULT);
402                 return;
403             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_COLUMN_NAME:
404                 setTargetColumnName(TARGET_COLUMN_NAME_EDEFAULT);
405                 return;
406             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_TABLE_ID:
407                 setTargetTableID(TARGET_TABLE_ID_EDEFAULT);
408                 return;
409             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_TABLE_NAME:
410                 setTargetTableName(TARGET_TABLE_NAME_EDEFAULT);
411                 return;
412             case OljPackage.USER_ID_COLUMN_TYPE__VALUE_MODE:
413                 unsetValueMode();
414                 return;
415         }
416         eDynamicUnset(eFeature);
417     }
418
419     /**
420      * <!-- begin-user-doc -->
421      * <!-- end-user-doc -->
422      * @generated
423      */

424     public boolean eIsSet(EStructuralFeature eFeature) {
425         switch (eDerivedStructuralFeatureID(eFeature)) {
426             case OljPackage.USER_ID_COLUMN_TYPE__DEFAULT_VALUE:
427                 return DEFAULT_VALUE_EDEFAULT == null ? defaultValue != null : !DEFAULT_VALUE_EDEFAULT.equals(defaultValue);
428             case OljPackage.USER_ID_COLUMN_TYPE__NAME:
429                 return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
430             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_COLUMN_NAME:
431                 return TARGET_COLUMN_NAME_EDEFAULT == null ? targetColumnName != null : !TARGET_COLUMN_NAME_EDEFAULT.equals(targetColumnName);
432             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_TABLE_ID:
433                 return TARGET_TABLE_ID_EDEFAULT == null ? targetTableID != null : !TARGET_TABLE_ID_EDEFAULT.equals(targetTableID);
434             case OljPackage.USER_ID_COLUMN_TYPE__TARGET_TABLE_NAME:
435                 return TARGET_TABLE_NAME_EDEFAULT == null ? targetTableName != null : !TARGET_TABLE_NAME_EDEFAULT.equals(targetTableName);
436             case OljPackage.USER_ID_COLUMN_TYPE__VALUE_MODE:
437                 return isSetValueMode();
438         }
439         return eDynamicIsSet(eFeature);
440     }
441
442     /**
443      * <!-- begin-user-doc -->
444      * <!-- end-user-doc -->
445      * @generated
446      */

447     public String JavaDoc toString() {
448         if (eIsProxy()) return super.toString();
449
450         StringBuffer JavaDoc result = new StringBuffer JavaDoc(super.toString());
451         result.append(" (defaultValue: ");
452         result.append(defaultValue);
453         result.append(", name: ");
454         result.append(name);
455         result.append(", targetColumnName: ");
456         result.append(targetColumnName);
457         result.append(", targetTableID: ");
458         result.append(targetTableID);
459         result.append(", targetTableName: ");
460         result.append(targetTableName);
461         result.append(", valueMode: ");
462         if (valueModeESet) result.append(valueMode); else result.append("<unset>");
463         result.append(')');
464         return result.toString();
465     }
466
467 } //UserIDColumnTypeImpl
468
Popular Tags