1 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 ; 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 50 public class TransformationTypeImpl extends EObjectImpl implements TransformationType { 51 59 protected EList sourceColumns = null; 60 61 69 protected EList targetColumns = null; 70 71 79 protected JavaScriptType javaScript = null; 80 81 89 protected static final String NAME_EDEFAULT = null; 90 91 99 protected String name = NAME_EDEFAULT; 100 101 109 protected static final String TRANSFORMATOR_CLASS_NAME_EDEFAULT = null; 110 111 119 protected String transformatorClassName = TRANSFORMATOR_CLASS_NAME_EDEFAULT; 120 121 129 protected static final String TRANSFORMATOR_CONFIG_EDEFAULT = null; 130 131 139 protected String transformatorConfig = TRANSFORMATOR_CONFIG_EDEFAULT; 140 141 146 protected TransformationTypeImpl() { 147 super(); 148 } 149 150 155 protected EClass eStaticClass() { 156 return OljPackage.eINSTANCE.getTransformationType(); 157 } 158 159 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 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 188 public JavaScriptType getJavaScript() { 189 return javaScript; 190 } 191 192 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 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 231 public String getName() { 232 return name; 233 } 234 235 240 public void setName(String newName) { 241 String oldName = name; 242 name = newName; 243 if (eNotificationRequired()) 244 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TRANSFORMATION_TYPE__NAME, oldName, name)); 245 } 246 247 252 public String getTransformatorClassName() { 253 return transformatorClassName; 254 } 255 256 261 public void setTransformatorClassName(String newTransformatorClassName) { 262 String 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 273 public String getTransformatorConfig() { 274 return transformatorConfig; 275 } 276 277 282 public void setTransformatorConfig(String newTransformatorConfig) { 283 String 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 294 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class 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 315 public Object 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 338 public void eSet(EStructuralFeature eFeature, Object newValue) { 339 switch (eDerivedStructuralFeatureID(eFeature)) { 340 case OljPackage.TRANSFORMATION_TYPE__SOURCE_COLUMNS: 341 getSourceColumns().clear(); 342 getSourceColumns().addAll((Collection )newValue); 343 return; 344 case OljPackage.TRANSFORMATION_TYPE__TARGET_COLUMNS: 345 getTargetColumns().clear(); 346 getTargetColumns().addAll((Collection )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 )newValue); 353 return; 354 case OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CLASS_NAME: 355 setTransformatorClassName((String )newValue); 356 return; 357 case OljPackage.TRANSFORMATION_TYPE__TRANSFORMATOR_CONFIG: 358 setTransformatorConfig((String )newValue); 359 return; 360 } 361 eDynamicSet(eFeature, newValue); 362 } 363 364 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 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 421 public String toString() { 422 if (eIsProxy()) return super.toString(); 423 424 StringBuffer result = new StringBuffer (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 } | Popular Tags |