KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > impl > VariablesTypeImpl


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

7 package Olj.impl;
8
9 import Olj.OljPackage;
10 import Olj.VariableType;
11 import Olj.VariablesType;
12
13 import java.util.Collection JavaDoc;
14
15 import org.eclipse.emf.common.notify.Notification;
16 import org.eclipse.emf.common.notify.NotificationChain;
17
18 import org.eclipse.emf.common.util.EList;
19
20 import org.eclipse.emf.ecore.EClass;
21 import org.eclipse.emf.ecore.EStructuralFeature;
22 import org.eclipse.emf.ecore.InternalEObject;
23
24 import org.eclipse.emf.ecore.impl.ENotificationImpl;
25 import org.eclipse.emf.ecore.impl.EObjectImpl;
26
27 import org.eclipse.emf.ecore.util.EObjectContainmentEList;
28 import org.eclipse.emf.ecore.util.InternalEList;
29
30 /**
31  * <!-- begin-user-doc -->
32  * An implementation of the model object '<em><b>Variables Type</b></em>'.
33  * <!-- end-user-doc -->
34  * <p>
35  * The following features are implemented:
36  * <ul>
37  * <li>{@link Olj.impl.VariablesTypeImpl#getVariable <em>Variable</em>}</li>
38  * <li>{@link Olj.impl.VariablesTypeImpl#getOverride <em>Override</em>}</li>
39  * <li>{@link Olj.impl.VariablesTypeImpl#getPrefix <em>Prefix</em>}</li>
40  * <li>{@link Olj.impl.VariablesTypeImpl#getReplaceInConstants <em>Replace In Constants</em>}</li>
41  * <li>{@link Olj.impl.VariablesTypeImpl#getReplaceInData <em>Replace In Data</em>}</li>
42  * <li>{@link Olj.impl.VariablesTypeImpl#getReplaceInJDBC <em>Replace In JDBC</em>}</li>
43  * <li>{@link Olj.impl.VariablesTypeImpl#getReplaceInSQL <em>Replace In SQL</em>}</li>
44  * <li>{@link Olj.impl.VariablesTypeImpl#getSuffix <em>Suffix</em>}</li>
45  * </ul>
46  * </p>
47  *
48  * @generated
49  */

50 public class VariablesTypeImpl extends EObjectImpl implements VariablesType {
51     /**
52      * The cached value of the '{@link #getVariable() <em>Variable</em>}' containment reference list.
53      * <!-- begin-user-doc -->
54      * <!-- end-user-doc -->
55      * @see #getVariable()
56      * @generated
57      * @ordered
58      */

59     protected EList variable = null;
60
61     /**
62      * The default value of the '{@link #getOverride() <em>Override</em>}' attribute.
63      * <!-- begin-user-doc -->
64      * <!-- end-user-doc -->
65      * @see #getOverride()
66      * @generated
67      * @ordered
68      */

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

79     protected String JavaDoc override = OVERRIDE_EDEFAULT;
80
81     /**
82      * The default value of the '{@link #getPrefix() <em>Prefix</em>}' attribute.
83      * <!-- begin-user-doc -->
84      * <!-- end-user-doc -->
85      * @see #getPrefix()
86      * @generated
87      * @ordered
88      */

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

99     protected String JavaDoc prefix = PREFIX_EDEFAULT;
100
101     /**
102      * The default value of the '{@link #getReplaceInConstants() <em>Replace In Constants</em>}' attribute.
103      * <!-- begin-user-doc -->
104      * <!-- end-user-doc -->
105      * @see #getReplaceInConstants()
106      * @generated
107      * @ordered
108      */

109     protected static final String JavaDoc REPLACE_IN_CONSTANTS_EDEFAULT = null;
110
111     /**
112      * The cached value of the '{@link #getReplaceInConstants() <em>Replace In Constants</em>}' attribute.
113      * <!-- begin-user-doc -->
114      * <!-- end-user-doc -->
115      * @see #getReplaceInConstants()
116      * @generated
117      * @ordered
118      */

119     protected String JavaDoc replaceInConstants = REPLACE_IN_CONSTANTS_EDEFAULT;
120
121     /**
122      * The default value of the '{@link #getReplaceInData() <em>Replace In Data</em>}' attribute.
123      * <!-- begin-user-doc -->
124      * <!-- end-user-doc -->
125      * @see #getReplaceInData()
126      * @generated
127      * @ordered
128      */

129     protected static final String JavaDoc REPLACE_IN_DATA_EDEFAULT = null;
130
131     /**
132      * The cached value of the '{@link #getReplaceInData() <em>Replace In Data</em>}' attribute.
133      * <!-- begin-user-doc -->
134      * <!-- end-user-doc -->
135      * @see #getReplaceInData()
136      * @generated
137      * @ordered
138      */

139     protected String JavaDoc replaceInData = REPLACE_IN_DATA_EDEFAULT;
140
141     /**
142      * The default value of the '{@link #getReplaceInJDBC() <em>Replace In JDBC</em>}' attribute.
143      * <!-- begin-user-doc -->
144      * <!-- end-user-doc -->
145      * @see #getReplaceInJDBC()
146      * @generated
147      * @ordered
148      */

149     protected static final String JavaDoc REPLACE_IN_JDBC_EDEFAULT = null;
150
151     /**
152      * The cached value of the '{@link #getReplaceInJDBC() <em>Replace In JDBC</em>}' attribute.
153      * <!-- begin-user-doc -->
154      * <!-- end-user-doc -->
155      * @see #getReplaceInJDBC()
156      * @generated
157      * @ordered
158      */

159     protected String JavaDoc replaceInJDBC = REPLACE_IN_JDBC_EDEFAULT;
160
161     /**
162      * The default value of the '{@link #getReplaceInSQL() <em>Replace In SQL</em>}' attribute.
163      * <!-- begin-user-doc -->
164      * <!-- end-user-doc -->
165      * @see #getReplaceInSQL()
166      * @generated
167      * @ordered
168      */

169     protected static final String JavaDoc REPLACE_IN_SQL_EDEFAULT = null;
170
171     /**
172      * The cached value of the '{@link #getReplaceInSQL() <em>Replace In SQL</em>}' attribute.
173      * <!-- begin-user-doc -->
174      * <!-- end-user-doc -->
175      * @see #getReplaceInSQL()
176      * @generated
177      * @ordered
178      */

179     protected String JavaDoc replaceInSQL = REPLACE_IN_SQL_EDEFAULT;
180
181     /**
182      * The default value of the '{@link #getSuffix() <em>Suffix</em>}' attribute.
183      * <!-- begin-user-doc -->
184      * <!-- end-user-doc -->
185      * @see #getSuffix()
186      * @generated
187      * @ordered
188      */

189     protected static final String JavaDoc SUFFIX_EDEFAULT = null;
190
191     /**
192      * The cached value of the '{@link #getSuffix() <em>Suffix</em>}' attribute.
193      * <!-- begin-user-doc -->
194      * <!-- end-user-doc -->
195      * @see #getSuffix()
196      * @generated
197      * @ordered
198      */

199     protected String JavaDoc suffix = SUFFIX_EDEFAULT;
200
201     /**
202      * <!-- begin-user-doc -->
203      * <!-- end-user-doc -->
204      * @generated
205      */

206     protected VariablesTypeImpl() {
207         super();
208     }
209
210     /**
211      * <!-- begin-user-doc -->
212      * <!-- end-user-doc -->
213      * @generated
214      */

215     protected EClass eStaticClass() {
216         return OljPackage.eINSTANCE.getVariablesType();
217     }
218
219     /**
220      * <!-- begin-user-doc -->
221      * <!-- end-user-doc -->
222      * @generated
223      */

224     public EList getVariable() {
225         if (variable == null) {
226             variable = new EObjectContainmentEList(VariableType.class, this, OljPackage.VARIABLES_TYPE__VARIABLE);
227         }
228         return variable;
229     }
230
231     /**
232      * <!-- begin-user-doc -->
233      * <!-- end-user-doc -->
234      * @generated
235      */

236     public String JavaDoc getOverride() {
237         return override;
238     }
239
240     /**
241      * <!-- begin-user-doc -->
242      * <!-- end-user-doc -->
243      * @generated
244      */

245     public void setOverride(String JavaDoc newOverride) {
246         String JavaDoc oldOverride = override;
247         override = newOverride;
248         if (eNotificationRequired())
249             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLES_TYPE__OVERRIDE, oldOverride, override));
250     }
251
252     /**
253      * <!-- begin-user-doc -->
254      * <!-- end-user-doc -->
255      * @generated
256      */

257     public String JavaDoc getPrefix() {
258         return prefix;
259     }
260
261     /**
262      * <!-- begin-user-doc -->
263      * <!-- end-user-doc -->
264      * @generated
265      */

266     public void setPrefix(String JavaDoc newPrefix) {
267         String JavaDoc oldPrefix = prefix;
268         prefix = newPrefix;
269         if (eNotificationRequired())
270             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLES_TYPE__PREFIX, oldPrefix, prefix));
271     }
272
273     /**
274      * <!-- begin-user-doc -->
275      * <!-- end-user-doc -->
276      * @generated
277      */

278     public String JavaDoc getReplaceInConstants() {
279         return replaceInConstants;
280     }
281
282     /**
283      * <!-- begin-user-doc -->
284      * <!-- end-user-doc -->
285      * @generated
286      */

287     public void setReplaceInConstants(String JavaDoc newReplaceInConstants) {
288         String JavaDoc oldReplaceInConstants = replaceInConstants;
289         replaceInConstants = newReplaceInConstants;
290         if (eNotificationRequired())
291             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLES_TYPE__REPLACE_IN_CONSTANTS, oldReplaceInConstants, replaceInConstants));
292     }
293
294     /**
295      * <!-- begin-user-doc -->
296      * <!-- end-user-doc -->
297      * @generated
298      */

299     public String JavaDoc getReplaceInData() {
300         return replaceInData;
301     }
302
303     /**
304      * <!-- begin-user-doc -->
305      * <!-- end-user-doc -->
306      * @generated
307      */

308     public void setReplaceInData(String JavaDoc newReplaceInData) {
309         String JavaDoc oldReplaceInData = replaceInData;
310         replaceInData = newReplaceInData;
311         if (eNotificationRequired())
312             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLES_TYPE__REPLACE_IN_DATA, oldReplaceInData, replaceInData));
313     }
314
315     /**
316      * <!-- begin-user-doc -->
317      * <!-- end-user-doc -->
318      * @generated
319      */

320     public String JavaDoc getReplaceInJDBC() {
321         return replaceInJDBC;
322     }
323
324     /**
325      * <!-- begin-user-doc -->
326      * <!-- end-user-doc -->
327      * @generated
328      */

329     public void setReplaceInJDBC(String JavaDoc newReplaceInJDBC) {
330         String JavaDoc oldReplaceInJDBC = replaceInJDBC;
331         replaceInJDBC = newReplaceInJDBC;
332         if (eNotificationRequired())
333             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLES_TYPE__REPLACE_IN_JDBC, oldReplaceInJDBC, replaceInJDBC));
334     }
335
336     /**
337      * <!-- begin-user-doc -->
338      * <!-- end-user-doc -->
339      * @generated
340      */

341     public String JavaDoc getReplaceInSQL() {
342         return replaceInSQL;
343     }
344
345     /**
346      * <!-- begin-user-doc -->
347      * <!-- end-user-doc -->
348      * @generated
349      */

350     public void setReplaceInSQL(String JavaDoc newReplaceInSQL) {
351         String JavaDoc oldReplaceInSQL = replaceInSQL;
352         replaceInSQL = newReplaceInSQL;
353         if (eNotificationRequired())
354             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLES_TYPE__REPLACE_IN_SQL, oldReplaceInSQL, replaceInSQL));
355     }
356
357     /**
358      * <!-- begin-user-doc -->
359      * <!-- end-user-doc -->
360      * @generated
361      */

362     public String JavaDoc getSuffix() {
363         return suffix;
364     }
365
366     /**
367      * <!-- begin-user-doc -->
368      * <!-- end-user-doc -->
369      * @generated
370      */

371     public void setSuffix(String JavaDoc newSuffix) {
372         String JavaDoc oldSuffix = suffix;
373         suffix = newSuffix;
374         if (eNotificationRequired())
375             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLES_TYPE__SUFFIX, oldSuffix, suffix));
376     }
377
378     /**
379      * <!-- begin-user-doc -->
380      * <!-- end-user-doc -->
381      * @generated
382      */

383     public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class JavaDoc baseClass, NotificationChain msgs) {
384         if (featureID >= 0) {
385             switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
386                 case OljPackage.VARIABLES_TYPE__VARIABLE:
387                     return ((InternalEList)getVariable()).basicRemove(otherEnd, msgs);
388                 default:
389                     return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
390             }
391         }
392         return eBasicSetContainer(null, featureID, msgs);
393     }
394
395     /**
396      * <!-- begin-user-doc -->
397      * <!-- end-user-doc -->
398      * @generated
399      */

400     public Object JavaDoc eGet(EStructuralFeature eFeature, boolean resolve) {
401         switch (eDerivedStructuralFeatureID(eFeature)) {
402             case OljPackage.VARIABLES_TYPE__VARIABLE:
403                 return getVariable();
404             case OljPackage.VARIABLES_TYPE__OVERRIDE:
405                 return getOverride();
406             case OljPackage.VARIABLES_TYPE__PREFIX:
407                 return getPrefix();
408             case OljPackage.VARIABLES_TYPE__REPLACE_IN_CONSTANTS:
409                 return getReplaceInConstants();
410             case OljPackage.VARIABLES_TYPE__REPLACE_IN_DATA:
411                 return getReplaceInData();
412             case OljPackage.VARIABLES_TYPE__REPLACE_IN_JDBC:
413                 return getReplaceInJDBC();
414             case OljPackage.VARIABLES_TYPE__REPLACE_IN_SQL:
415                 return getReplaceInSQL();
416             case OljPackage.VARIABLES_TYPE__SUFFIX:
417                 return getSuffix();
418         }
419         return eDynamicGet(eFeature, resolve);
420     }
421
422     /**
423      * <!-- begin-user-doc -->
424      * <!-- end-user-doc -->
425      * @generated
426      */

427     public void eSet(EStructuralFeature eFeature, Object JavaDoc newValue) {
428         switch (eDerivedStructuralFeatureID(eFeature)) {
429             case OljPackage.VARIABLES_TYPE__VARIABLE:
430                 getVariable().clear();
431                 getVariable().addAll((Collection JavaDoc)newValue);
432                 return;
433             case OljPackage.VARIABLES_TYPE__OVERRIDE:
434                 setOverride((String JavaDoc)newValue);
435                 return;
436             case OljPackage.VARIABLES_TYPE__PREFIX:
437                 setPrefix((String JavaDoc)newValue);
438                 return;
439             case OljPackage.VARIABLES_TYPE__REPLACE_IN_CONSTANTS:
440                 setReplaceInConstants((String JavaDoc)newValue);
441                 return;
442             case OljPackage.VARIABLES_TYPE__REPLACE_IN_DATA:
443                 setReplaceInData((String JavaDoc)newValue);
444                 return;
445             case OljPackage.VARIABLES_TYPE__REPLACE_IN_JDBC:
446                 setReplaceInJDBC((String JavaDoc)newValue);
447                 return;
448             case OljPackage.VARIABLES_TYPE__REPLACE_IN_SQL:
449                 setReplaceInSQL((String JavaDoc)newValue);
450                 return;
451             case OljPackage.VARIABLES_TYPE__SUFFIX:
452                 setSuffix((String JavaDoc)newValue);
453                 return;
454         }
455         eDynamicSet(eFeature, newValue);
456     }
457
458     /**
459      * <!-- begin-user-doc -->
460      * <!-- end-user-doc -->
461      * @generated
462      */

463     public void eUnset(EStructuralFeature eFeature) {
464         switch (eDerivedStructuralFeatureID(eFeature)) {
465             case OljPackage.VARIABLES_TYPE__VARIABLE:
466                 getVariable().clear();
467                 return;
468             case OljPackage.VARIABLES_TYPE__OVERRIDE:
469                 setOverride(OVERRIDE_EDEFAULT);
470                 return;
471             case OljPackage.VARIABLES_TYPE__PREFIX:
472                 setPrefix(PREFIX_EDEFAULT);
473                 return;
474             case OljPackage.VARIABLES_TYPE__REPLACE_IN_CONSTANTS:
475                 setReplaceInConstants(REPLACE_IN_CONSTANTS_EDEFAULT);
476                 return;
477             case OljPackage.VARIABLES_TYPE__REPLACE_IN_DATA:
478                 setReplaceInData(REPLACE_IN_DATA_EDEFAULT);
479                 return;
480             case OljPackage.VARIABLES_TYPE__REPLACE_IN_JDBC:
481                 setReplaceInJDBC(REPLACE_IN_JDBC_EDEFAULT);
482                 return;
483             case OljPackage.VARIABLES_TYPE__REPLACE_IN_SQL:
484                 setReplaceInSQL(REPLACE_IN_SQL_EDEFAULT);
485                 return;
486             case OljPackage.VARIABLES_TYPE__SUFFIX:
487                 setSuffix(SUFFIX_EDEFAULT);
488                 return;
489         }
490         eDynamicUnset(eFeature);
491     }
492
493     /**
494      * <!-- begin-user-doc -->
495      * <!-- end-user-doc -->
496      * @generated
497      */

498     public boolean eIsSet(EStructuralFeature eFeature) {
499         switch (eDerivedStructuralFeatureID(eFeature)) {
500             case OljPackage.VARIABLES_TYPE__VARIABLE:
501                 return variable != null && !variable.isEmpty();
502             case OljPackage.VARIABLES_TYPE__OVERRIDE:
503                 return OVERRIDE_EDEFAULT == null ? override != null : !OVERRIDE_EDEFAULT.equals(override);
504             case OljPackage.VARIABLES_TYPE__PREFIX:
505                 return PREFIX_EDEFAULT == null ? prefix != null : !PREFIX_EDEFAULT.equals(prefix);
506             case OljPackage.VARIABLES_TYPE__REPLACE_IN_CONSTANTS:
507                 return REPLACE_IN_CONSTANTS_EDEFAULT == null ? replaceInConstants != null : !REPLACE_IN_CONSTANTS_EDEFAULT.equals(replaceInConstants);
508             case OljPackage.VARIABLES_TYPE__REPLACE_IN_DATA:
509                 return REPLACE_IN_DATA_EDEFAULT == null ? replaceInData != null : !REPLACE_IN_DATA_EDEFAULT.equals(replaceInData);
510             case OljPackage.VARIABLES_TYPE__REPLACE_IN_JDBC:
511                 return REPLACE_IN_JDBC_EDEFAULT == null ? replaceInJDBC != null : !REPLACE_IN_JDBC_EDEFAULT.equals(replaceInJDBC);
512             case OljPackage.VARIABLES_TYPE__REPLACE_IN_SQL:
513                 return REPLACE_IN_SQL_EDEFAULT == null ? replaceInSQL != null : !REPLACE_IN_SQL_EDEFAULT.equals(replaceInSQL);
514             case OljPackage.VARIABLES_TYPE__SUFFIX:
515                 return SUFFIX_EDEFAULT == null ? suffix != null : !SUFFIX_EDEFAULT.equals(suffix);
516         }
517         return eDynamicIsSet(eFeature);
518     }
519
520     /**
521      * <!-- begin-user-doc -->
522      * <!-- end-user-doc -->
523      * @generated
524      */

525     public String JavaDoc toString() {
526         if (eIsProxy()) return super.toString();
527
528         StringBuffer JavaDoc result = new StringBuffer JavaDoc(super.toString());
529         result.append(" (override: ");
530         result.append(override);
531         result.append(", prefix: ");
532         result.append(prefix);
533         result.append(", replaceInConstants: ");
534         result.append(replaceInConstants);
535         result.append(", replaceInData: ");
536         result.append(replaceInData);
537         result.append(", replaceInJDBC: ");
538         result.append(replaceInJDBC);
539         result.append(", replaceInSQL: ");
540         result.append(replaceInSQL);
541         result.append(", suffix: ");
542         result.append(suffix);
543         result.append(')');
544         return result.toString();
545     }
546
547 } //VariablesTypeImpl
548
Popular Tags