1 7 package Olj.impl; 8 9 import Olj.OljPackage; 10 import Olj.VariableType; 11 import Olj.VariablesType; 12 13 import java.util.Collection ; 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 50 public class VariablesTypeImpl extends EObjectImpl implements VariablesType { 51 59 protected EList variable = null; 60 61 69 protected static final String OVERRIDE_EDEFAULT = null; 70 71 79 protected String override = OVERRIDE_EDEFAULT; 80 81 89 protected static final String PREFIX_EDEFAULT = null; 90 91 99 protected String prefix = PREFIX_EDEFAULT; 100 101 109 protected static final String REPLACE_IN_CONSTANTS_EDEFAULT = null; 110 111 119 protected String replaceInConstants = REPLACE_IN_CONSTANTS_EDEFAULT; 120 121 129 protected static final String REPLACE_IN_DATA_EDEFAULT = null; 130 131 139 protected String replaceInData = REPLACE_IN_DATA_EDEFAULT; 140 141 149 protected static final String REPLACE_IN_JDBC_EDEFAULT = null; 150 151 159 protected String replaceInJDBC = REPLACE_IN_JDBC_EDEFAULT; 160 161 169 protected static final String REPLACE_IN_SQL_EDEFAULT = null; 170 171 179 protected String replaceInSQL = REPLACE_IN_SQL_EDEFAULT; 180 181 189 protected static final String SUFFIX_EDEFAULT = null; 190 191 199 protected String suffix = SUFFIX_EDEFAULT; 200 201 206 protected VariablesTypeImpl() { 207 super(); 208 } 209 210 215 protected EClass eStaticClass() { 216 return OljPackage.eINSTANCE.getVariablesType(); 217 } 218 219 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 236 public String getOverride() { 237 return override; 238 } 239 240 245 public void setOverride(String newOverride) { 246 String oldOverride = override; 247 override = newOverride; 248 if (eNotificationRequired()) 249 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLES_TYPE__OVERRIDE, oldOverride, override)); 250 } 251 252 257 public String getPrefix() { 258 return prefix; 259 } 260 261 266 public void setPrefix(String newPrefix) { 267 String oldPrefix = prefix; 268 prefix = newPrefix; 269 if (eNotificationRequired()) 270 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLES_TYPE__PREFIX, oldPrefix, prefix)); 271 } 272 273 278 public String getReplaceInConstants() { 279 return replaceInConstants; 280 } 281 282 287 public void setReplaceInConstants(String newReplaceInConstants) { 288 String 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 299 public String getReplaceInData() { 300 return replaceInData; 301 } 302 303 308 public void setReplaceInData(String newReplaceInData) { 309 String 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 320 public String getReplaceInJDBC() { 321 return replaceInJDBC; 322 } 323 324 329 public void setReplaceInJDBC(String newReplaceInJDBC) { 330 String 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 341 public String getReplaceInSQL() { 342 return replaceInSQL; 343 } 344 345 350 public void setReplaceInSQL(String newReplaceInSQL) { 351 String 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 362 public String getSuffix() { 363 return suffix; 364 } 365 366 371 public void setSuffix(String newSuffix) { 372 String oldSuffix = suffix; 373 suffix = newSuffix; 374 if (eNotificationRequired()) 375 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLES_TYPE__SUFFIX, oldSuffix, suffix)); 376 } 377 378 383 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class 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 400 public Object 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 427 public void eSet(EStructuralFeature eFeature, Object newValue) { 428 switch (eDerivedStructuralFeatureID(eFeature)) { 429 case OljPackage.VARIABLES_TYPE__VARIABLE: 430 getVariable().clear(); 431 getVariable().addAll((Collection )newValue); 432 return; 433 case OljPackage.VARIABLES_TYPE__OVERRIDE: 434 setOverride((String )newValue); 435 return; 436 case OljPackage.VARIABLES_TYPE__PREFIX: 437 setPrefix((String )newValue); 438 return; 439 case OljPackage.VARIABLES_TYPE__REPLACE_IN_CONSTANTS: 440 setReplaceInConstants((String )newValue); 441 return; 442 case OljPackage.VARIABLES_TYPE__REPLACE_IN_DATA: 443 setReplaceInData((String )newValue); 444 return; 445 case OljPackage.VARIABLES_TYPE__REPLACE_IN_JDBC: 446 setReplaceInJDBC((String )newValue); 447 return; 448 case OljPackage.VARIABLES_TYPE__REPLACE_IN_SQL: 449 setReplaceInSQL((String )newValue); 450 return; 451 case OljPackage.VARIABLES_TYPE__SUFFIX: 452 setSuffix((String )newValue); 453 return; 454 } 455 eDynamicSet(eFeature, newValue); 456 } 457 458 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 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 525 public String toString() { 526 if (eIsProxy()) return super.toString(); 527 528 StringBuffer result = new StringBuffer (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 } | Popular Tags |