KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > impl > TransformationTypeImpl


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

7 package Olj.impl;
8
9 import Olj.JavaScriptType;
10 import Olj.OljPackage;
11 import Olj.SourceColumnsType;
12 import Olj.TargetColumnsType;
13 import Olj.TransformationType;
14
15 import java.util.Collection JavaDoc;
16
17 import org.eclipse.emf.common.notify.Notification;
18 import org.eclipse.emf.common.notify.NotificationChain;
19
20 import org.eclipse.emf.common.util.EList;
21
22 import org.eclipse.emf.ecore.EClass;
23 import org.eclipse.emf.ecore.EStructuralFeature;
24 import org.eclipse.emf.ecore.InternalEObject;
25
26 import org.eclipse.emf.ecore.impl.ENotificationImpl;
27 import org.eclipse.emf.ecore.impl.EObjectImpl;
28
29 import org.eclipse.emf.ecore.util.EObjectContainmentEList;
30 import org.eclipse.emf.ecore.util.InternalEList;
31
32 /**
33  * <!-- begin-user-doc -->
34  * An implementation of the model object '<em><b>Transformation Type</b></em>'.
35  * <!-- end-user-doc -->
36  * <p>
37  * The following features are implemented:
38  * <ul>
39  * <li>{@link Olj.impl.TransformationTypeImpl#getSourceColumns <em>Source Columns</em>}</li>
40  * <li>{@link Olj.impl.TransformationTypeImpl#getTargetColumns <em>Target Columns</em>}</li>
41  * <li>{@link Olj.impl.TransformationTypeImpl#getJavaScript <em>Java Script</em>}</li>
42  * <li>{@link Olj.impl.TransformationTypeImpl#getName <em>Name</em>}</li>
43  * <li>{@link Olj.impl.TransformationTypeImpl#getTransformatorClassName <em>Transformator Class Name</em>}</li>
44  * <li>{@link Olj.impl.TransformationTypeImpl#getTransformatorConfig <em>Transformator Config</em>}</li>
45  * </ul>
46  * </p>
47  *
48  * @generated
49  */

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

59     protected EList sourceColumns = null;
60
61     /**
62      * The cached value of the '{@link #getTargetColumns() <em>Target Columns</em>}' containment reference list.
63      * <!-- begin-user-doc -->
64      * <!-- end-user-doc -->
65      * @see #getTargetColumns()
66      * @generated
67      * @ordered
68      */

69     protected EList targetColumns = null;
70
71     /**
72      * The cached value of the '{@link #getJavaScript() <em>Java Script</em>}' containment reference.
73      * <!-- begin-user-doc -->
74      * <!-- end-user-doc -->
75      * @see #getJavaScript()
76      * @generated
77      * @ordered
78      */

79     protected JavaScriptType javaScript = null;
80
81     /**
82      * The default value of the '{@link #getName() <em>Name</em>}' attribute.
83      * <!-- begin-user-doc -->
84      * <!-- end-user-doc -->
85      * @see #getName()
86      * @generated
87      * @ordered
88      */

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

99     protected String JavaDoc name = NAME_EDEFAULT;
100
101     /**
102      * The default value of the '{@link #getTransformatorClassName() <em>Transformator Class Name</em>}' attribute.
103      * <!-- begin-user-doc -->
104      * <!-- end-user-doc -->
105      * @see #getTransformatorClassName()
106      * @generated
107      * @ordered
108      */

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

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

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

139     protected String JavaDoc transformatorConfig = TRANSFORMATOR_CONFIG_EDEFAULT;
140
141     /**
142      * <!-- begin-user-doc -->
143      * <!-- end-user-doc -->
144      * @generated
145      */

146     protected TransformationTypeImpl() {
147         super();
148     }
149
150     /**
151      * <!-- begin-user-doc -->
152      * <!-- end-user-doc -->
153      * @generated
154      */

155     protected EClass eStaticClass() {
156         return OljPackage.eINSTANCE.getTransformationType();
157     }
158
159     /**
160      * <!-- begin-user-doc -->
161      * <!-- end-user-doc -->
162      * @generated
163      */

164     public EList getSourceColumns() {
165         if (sourceColumns == null) {
166             sourceColumns = new EObjectContainmentEList(SourceColumnsType.class, this, OljPackage.TRANSFORMATION_TYPE__SOURCE_COLUMNS);
167         }
168         return sourceColumns;
169     }
170
171     /**
172      * <!-- begin-user-doc -->
173      * <!-- end-user-doc -->
174      * @generated
175      */

176     public EList getTargetColumns() {
177         if (targetColumns == null) {
178             targetColumns = new EObjectContainmentEList(TargetColumnsType.class, this, OljPackage.TRANSFORMATION_TYPE__TARGET_COLUMNS);
179         }
180         return targetColumns;
181     }
182
183     /**
184      * <!-- begin-user-doc -->
185      * <!-- end-user-doc -->
186      * @generated
187      */

188     public JavaScriptType getJavaScript() {
189         return javaScript;
190     }
191
192     /**
193      * <!-- begin-user-doc -->
194      * <!-- end-user-doc -->
195      * @generated
196      */

197     public NotificationChain basicSetJavaScript(JavaScriptType newJavaScript, NotificationChain msgs) {
198         JavaScriptType oldJavaScript = javaScript;
199         javaScript = newJavaScript;
200         if (eNotificationRequired()) {
201             ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OljPackage.TRANSFORMATION_TYPE__JAVA_SCRIPT, oldJavaScript, newJavaScript);
202             if (msgs == null) msgs = notification; else msgs.add(notification);
203         }
204         return msgs;
205     }
206
207     /**
208      * <!-- begin-user-doc -->
209      * <!-- end-user-doc -->
210      * @generated
211      */

212     public void setJavaScript(JavaScriptType newJavaScript) {
213         if (newJavaScript != javaScript) {
214             NotificationChain msgs = null;
215             if (javaScript != null)
216                 msgs = ((InternalEObject)javaScript).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OljPackage.TRANSFORMATION_TYPE__JAVA_SCRIPT, null, msgs);
217             if (newJavaScript != null)
218                 msgs = ((InternalEObject)newJavaScript).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OljPackage.TRANSFORMATION_TYPE__JAVA_SCRIPT, null, msgs);
219             msgs = basicSetJavaScript(newJavaScript, msgs);
220             if (msgs != null) msgs.dispatch();
221         }
222         else if (eNotificationRequired())
223             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TRANSFORMATION_TYPE__JAVA_SCRIPT, newJavaScript, newJavaScript));
224     }
225
226     /**
227      * <!-- begin-user-doc -->
228      * <!-- end-user-doc -->
229      * @generated
230      */

231     public String JavaDoc getName() {
232         return name;
233     }
234
235     /**
236      * <!-- begin-user-doc -->
237      * <!-- end-user-doc -->
238      * @generated
239      */

240     public void setName(String JavaDoc newName) {
241         String JavaDoc oldName = name;
242         name = newName;
243         if (eNotificationRequired())
244             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TRANSFORMATION_TYPE__NAME, oldName, name));
245     }
246
247     /**
248      * <!-- begin-user-doc -->
249      * <!-- end-user-doc -->
250      * @generated
251      */

252     public String JavaDoc getTransformatorClassName() {
253         return transformatorClassName;
254     }
255
256     /**
257      * <!-- begin-user-doc -->
258      * <!-- end-user-doc -->
259      * @generated
260      */

261     public void setTransformatorClassName(String JavaDoc newTransformatorClassName) {
262         String JavaDoc oldTransformatorClassName = transformatorClassName;
263         transformatorClassName = newTransformatorClassName;
264         if (eNotificationRequired())
265             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CLASS_NAME, oldTransformatorClassName, transformatorClassName));
266     }
267
268     /**
269      * <!-- begin-user-doc -->
270      * <!-- end-user-doc -->
271      * @generated
272      */

273     public String JavaDoc getTransformatorConfig() {
274         return transformatorConfig;
275     }
276
277     /**
278      * <!-- begin-user-doc -->
279      * <!-- end-user-doc -->
280      * @generated
281      */

282     public void setTransformatorConfig(String JavaDoc newTransformatorConfig) {
283         String JavaDoc oldTransformatorConfig = transformatorConfig;
284         transformatorConfig = newTransformatorConfig;
285         if (eNotificationRequired())
286             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CONFIG, oldTransformatorConfig, transformatorConfig));
287     }
288
289     /**
290      * <!-- begin-user-doc -->
291      * <!-- end-user-doc -->
292      * @generated
293      */

294     public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class JavaDoc baseClass, NotificationChain msgs) {
295         if (featureID >= 0) {
296             switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
297                 case OljPackage.TRANSFORMATION_TYPE__SOURCE_COLUMNS:
298                     return ((InternalEList)getSourceColumns()).basicRemove(otherEnd, msgs);
299                 case OljPackage.TRANSFORMATION_TYPE__TARGET_COLUMNS:
300                     return ((InternalEList)getTargetColumns()).basicRemove(otherEnd, msgs);
301                 case OljPackage.TRANSFORMATION_TYPE__JAVA_SCRIPT:
302                     return basicSetJavaScript(null, msgs);
303                 default:
304                     return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
305             }
306         }
307         return eBasicSetContainer(null, featureID, msgs);
308     }
309
310     /**
311      * <!-- begin-user-doc -->
312      * <!-- end-user-doc -->
313      * @generated
314      */

315     public Object JavaDoc eGet(EStructuralFeature eFeature, boolean resolve) {
316         switch (eDerivedStructuralFeatureID(eFeature)) {
317             case OljPackage.TRANSFORMATION_TYPE__SOURCE_COLUMNS:
318                 return getSourceColumns();
319             case OljPackage.TRANSFORMATION_TYPE__TARGET_COLUMNS:
320                 return getTargetColumns();
321             case OljPackage.TRANSFORMATION_TYPE__JAVA_SCRIPT:
322                 return getJavaScript();
323             case OljPackage.TRANSFORMATION_TYPE__NAME:
324                 return getName();
325             case OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CLASS_NAME:
326                 return getTransformatorClassName();
327             case OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CONFIG:
328                 return getTransformatorConfig();
329         }
330         return eDynamicGet(eFeature, resolve);
331     }
332
333     /**
334      * <!-- begin-user-doc -->
335      * <!-- end-user-doc -->
336      * @generated
337      */

338     public void eSet(EStructuralFeature eFeature, Object JavaDoc newValue) {
339         switch (eDerivedStructuralFeatureID(eFeature)) {
340             case OljPackage.TRANSFORMATION_TYPE__SOURCE_COLUMNS:
341                 getSourceColumns().clear();
342                 getSourceColumns().addAll((Collection JavaDoc)newValue);
343                 return;
344             case OljPackage.TRANSFORMATION_TYPE__TARGET_COLUMNS:
345                 getTargetColumns().clear();
346                 getTargetColumns().addAll((Collection JavaDoc)newValue);
347                 return;
348             case OljPackage.TRANSFORMATION_TYPE__JAVA_SCRIPT:
349                 setJavaScript((JavaScriptType)newValue);
350                 return;
351             case OljPackage.TRANSFORMATION_TYPE__NAME:
352                 setName((String JavaDoc)newValue);
353                 return;
354             case OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CLASS_NAME:
355                 setTransformatorClassName((String JavaDoc)newValue);
356                 return;
357             case OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CONFIG:
358                 setTransformatorConfig((String JavaDoc)newValue);
359                 return;
360         }
361         eDynamicSet(eFeature, newValue);
362     }
363
364     /**
365      * <!-- begin-user-doc -->
366      * <!-- end-user-doc -->
367      * @generated
368      */

369     public void eUnset(EStructuralFeature eFeature) {
370         switch (eDerivedStructuralFeatureID(eFeature)) {
371             case OljPackage.TRANSFORMATION_TYPE__SOURCE_COLUMNS:
372                 getSourceColumns().clear();
373                 return;
374             case OljPackage.TRANSFORMATION_TYPE__TARGET_COLUMNS:
375                 getTargetColumns().clear();
376                 return;
377             case OljPackage.TRANSFORMATION_TYPE__JAVA_SCRIPT:
378                 setJavaScript((JavaScriptType)null);
379                 return;
380             case OljPackage.TRANSFORMATION_TYPE__NAME:
381                 setName(NAME_EDEFAULT);
382                 return;
383             case OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CLASS_NAME:
384                 setTransformatorClassName(TRANSFORMATOR_CLASS_NAME_EDEFAULT);
385                 return;
386             case OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CONFIG:
387                 setTransformatorConfig(TRANSFORMATOR_CONFIG_EDEFAULT);
388                 return;
389         }
390         eDynamicUnset(eFeature);
391     }
392
393     /**
394      * <!-- begin-user-doc -->
395      * <!-- end-user-doc -->
396      * @generated
397      */

398     public boolean eIsSet(EStructuralFeature eFeature) {
399         switch (eDerivedStructuralFeatureID(eFeature)) {
400             case OljPackage.TRANSFORMATION_TYPE__SOURCE_COLUMNS:
401                 return sourceColumns != null && !sourceColumns.isEmpty();
402             case OljPackage.TRANSFORMATION_TYPE__TARGET_COLUMNS:
403                 return targetColumns != null && !targetColumns.isEmpty();
404             case OljPackage.TRANSFORMATION_TYPE__JAVA_SCRIPT:
405                 return javaScript != null;
406             case OljPackage.TRANSFORMATION_TYPE__NAME:
407                 return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
408             case OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CLASS_NAME:
409                 return TRANSFORMATOR_CLASS_NAME_EDEFAULT == null ? transformatorClassName != null : !TRANSFORMATOR_CLASS_NAME_EDEFAULT.equals(transformatorClassName);
410             case OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CONFIG:
411                 return TRANSFORMATOR_CONFIG_EDEFAULT == null ? transformatorConfig != null : !TRANSFORMATOR_CONFIG_EDEFAULT.equals(transformatorConfig);
412         }
413         return eDynamicIsSet(eFeature);
414     }
415
416     /**
417      * <!-- begin-user-doc -->
418      * <!-- end-user-doc -->
419      * @generated
420      */

421     public String JavaDoc toString() {
422         if (eIsProxy()) return super.toString();
423
424         StringBuffer JavaDoc result = new StringBuffer JavaDoc(super.toString());
425         result.append(" (name: ");
426         result.append(name);
427         result.append(", transformatorClassName: ");
428         result.append(transformatorClassName);
429         result.append(", transformatorConfig: ");
430         result.append(transformatorConfig);
431         result.append(')');
432         return result.toString();
433     }
434
435 } //TransformationTypeImpl
436
Popular Tags