1 7 package Olj.impl; 8 9 import Olj.OljPackage; 10 import Olj.ValueModeType1; 11 import Olj.VariableColumnType; 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 39 public class VariableColumnTypeImpl extends EObjectImpl implements VariableColumnType { 40 48 protected static final String DEFAULT_VALUE_EDEFAULT = null; 49 50 58 protected String defaultValue = DEFAULT_VALUE_EDEFAULT; 59 60 68 protected static final String NAME_EDEFAULT = null; 69 70 78 protected String name = NAME_EDEFAULT; 79 80 88 protected static final String TARGET_COLUMN_NAME_EDEFAULT = null; 89 90 98 protected String targetColumnName = TARGET_COLUMN_NAME_EDEFAULT; 99 100 108 protected static final String TARGET_TABLE_ID_EDEFAULT = null; 109 110 118 protected String targetTableID = TARGET_TABLE_ID_EDEFAULT; 119 120 128 protected static final String TARGET_TABLE_NAME_EDEFAULT = null; 129 130 138 protected String targetTableName = TARGET_TABLE_NAME_EDEFAULT; 139 140 148 protected static final ValueModeType1 VALUE_MODE_EDEFAULT = ValueModeType1.OVERWRITE_LITERAL; 149 150 158 protected ValueModeType1 valueMode = VALUE_MODE_EDEFAULT; 159 160 167 protected boolean valueModeESet = false; 168 169 174 protected VariableColumnTypeImpl() { 175 super(); 176 } 177 178 183 protected EClass eStaticClass() { 184 return OljPackage.eINSTANCE.getVariableColumnType(); 185 } 186 187 192 public String getDefaultValue() { 193 return defaultValue; 194 } 195 196 201 public void setDefaultValue(String newDefaultValue) { 202 String oldDefaultValue = defaultValue; 203 defaultValue = newDefaultValue; 204 if (eNotificationRequired()) 205 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLE_COLUMN_TYPE__DEFAULT_VALUE, oldDefaultValue, defaultValue)); 206 } 207 208 213 public String getName() { 214 return name; 215 } 216 217 222 public void setName(String newName) { 223 String oldName = name; 224 name = newName; 225 if (eNotificationRequired()) 226 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLE_COLUMN_TYPE__NAME, oldName, name)); 227 } 228 229 234 public String getTargetColumnName() { 235 return targetColumnName; 236 } 237 238 243 public void setTargetColumnName(String newTargetColumnName) { 244 String oldTargetColumnName = targetColumnName; 245 targetColumnName = newTargetColumnName; 246 if (eNotificationRequired()) 247 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLE_COLUMN_TYPE__TARGET_COLUMN_NAME, oldTargetColumnName, targetColumnName)); 248 } 249 250 255 public String getTargetTableID() { 256 return targetTableID; 257 } 258 259 264 public void setTargetTableID(String newTargetTableID) { 265 String oldTargetTableID = targetTableID; 266 targetTableID = newTargetTableID; 267 if (eNotificationRequired()) 268 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_ID, oldTargetTableID, targetTableID)); 269 } 270 271 276 public String getTargetTableName() { 277 return targetTableName; 278 } 279 280 285 public void setTargetTableName(String newTargetTableName) { 286 String oldTargetTableName = targetTableName; 287 targetTableName = newTargetTableName; 288 if (eNotificationRequired()) 289 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_NAME, oldTargetTableName, targetTableName)); 290 } 291 292 297 public ValueModeType1 getValueMode() { 298 return valueMode; 299 } 300 301 306 public void setValueMode(ValueModeType1 newValueMode) { 307 ValueModeType1 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.VARIABLE_COLUMN_TYPE__VALUE_MODE, oldValueMode, valueMode, !oldValueModeESet)); 313 } 314 315 320 public void unsetValueMode() { 321 ValueModeType1 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.VARIABLE_COLUMN_TYPE__VALUE_MODE, oldValueMode, VALUE_MODE_EDEFAULT, oldValueModeESet)); 327 } 328 329 334 public boolean isSetValueMode() { 335 return valueModeESet; 336 } 337 338 343 public Object eGet(EStructuralFeature eFeature, boolean resolve) { 344 switch (eDerivedStructuralFeatureID(eFeature)) { 345 case OljPackage.VARIABLE_COLUMN_TYPE__DEFAULT_VALUE: 346 return getDefaultValue(); 347 case OljPackage.VARIABLE_COLUMN_TYPE__NAME: 348 return getName(); 349 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_COLUMN_NAME: 350 return getTargetColumnName(); 351 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_ID: 352 return getTargetTableID(); 353 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_NAME: 354 return getTargetTableName(); 355 case OljPackage.VARIABLE_COLUMN_TYPE__VALUE_MODE: 356 return getValueMode(); 357 } 358 return eDynamicGet(eFeature, resolve); 359 } 360 361 366 public void eSet(EStructuralFeature eFeature, Object newValue) { 367 switch (eDerivedStructuralFeatureID(eFeature)) { 368 case OljPackage.VARIABLE_COLUMN_TYPE__DEFAULT_VALUE: 369 setDefaultValue((String )newValue); 370 return; 371 case OljPackage.VARIABLE_COLUMN_TYPE__NAME: 372 setName((String )newValue); 373 return; 374 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_COLUMN_NAME: 375 setTargetColumnName((String )newValue); 376 return; 377 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_ID: 378 setTargetTableID((String )newValue); 379 return; 380 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_NAME: 381 setTargetTableName((String )newValue); 382 return; 383 case OljPackage.VARIABLE_COLUMN_TYPE__VALUE_MODE: 384 setValueMode((ValueModeType1)newValue); 385 return; 386 } 387 eDynamicSet(eFeature, newValue); 388 } 389 390 395 public void eUnset(EStructuralFeature eFeature) { 396 switch (eDerivedStructuralFeatureID(eFeature)) { 397 case OljPackage.VARIABLE_COLUMN_TYPE__DEFAULT_VALUE: 398 setDefaultValue(DEFAULT_VALUE_EDEFAULT); 399 return; 400 case OljPackage.VARIABLE_COLUMN_TYPE__NAME: 401 setName(NAME_EDEFAULT); 402 return; 403 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_COLUMN_NAME: 404 setTargetColumnName(TARGET_COLUMN_NAME_EDEFAULT); 405 return; 406 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_ID: 407 setTargetTableID(TARGET_TABLE_ID_EDEFAULT); 408 return; 409 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_NAME: 410 setTargetTableName(TARGET_TABLE_NAME_EDEFAULT); 411 return; 412 case OljPackage.VARIABLE_COLUMN_TYPE__VALUE_MODE: 413 unsetValueMode(); 414 return; 415 } 416 eDynamicUnset(eFeature); 417 } 418 419 424 public boolean eIsSet(EStructuralFeature eFeature) { 425 switch (eDerivedStructuralFeatureID(eFeature)) { 426 case OljPackage.VARIABLE_COLUMN_TYPE__DEFAULT_VALUE: 427 return DEFAULT_VALUE_EDEFAULT == null ? defaultValue != null : !DEFAULT_VALUE_EDEFAULT.equals(defaultValue); 428 case OljPackage.VARIABLE_COLUMN_TYPE__NAME: 429 return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); 430 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_COLUMN_NAME: 431 return TARGET_COLUMN_NAME_EDEFAULT == null ? targetColumnName != null : !TARGET_COLUMN_NAME_EDEFAULT.equals(targetColumnName); 432 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_ID: 433 return TARGET_TABLE_ID_EDEFAULT == null ? targetTableID != null : !TARGET_TABLE_ID_EDEFAULT.equals(targetTableID); 434 case OljPackage.VARIABLE_COLUMN_TYPE__TARGET_TABLE_NAME: 435 return TARGET_TABLE_NAME_EDEFAULT == null ? targetTableName != null : !TARGET_TABLE_NAME_EDEFAULT.equals(targetTableName); 436 case OljPackage.VARIABLE_COLUMN_TYPE__VALUE_MODE: 437 return isSetValueMode(); 438 } 439 return eDynamicIsSet(eFeature); 440 } 441 442 447 public String toString() { 448 if (eIsProxy()) return super.toString(); 449 450 StringBuffer result = new StringBuffer (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 } | Popular Tags |