| /** |
| * <copyright> |
| * </copyright> |
| * |
| * $Id$ |
| */ |
| package org.eclipse.papyrus.infra.constraints.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.papyrus.infra.constraints.ConstraintsPackage; |
| import org.eclipse.papyrus.infra.constraints.ReferenceProperty; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Reference Property</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.infra.constraints.impl.ReferencePropertyImpl#getValue <em>Value</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ReferencePropertyImpl extends ConfigPropertyImpl implements ReferenceProperty { |
| /** |
| * The cached value of the '{@link #getValue() <em>Value</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getValue() |
| * @generated |
| * @ordered |
| */ |
| protected EObject value; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected ReferencePropertyImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ConstraintsPackage.Literals.REFERENCE_PROPERTY; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EObject getValue() { |
| if (value != null && value.eIsProxy()) { |
| InternalEObject oldValue = (InternalEObject) value; |
| value = eResolveProxy(oldValue); |
| if (value != oldValue) { |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ConstraintsPackage.REFERENCE_PROPERTY__VALUE, oldValue, value)); |
| } |
| } |
| } |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EObject basicGetValue() { |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setValue(EObject newValue) { |
| EObject oldValue = value; |
| value = newValue; |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.SET, ConstraintsPackage.REFERENCE_PROPERTY__VALUE, oldValue, value)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ConstraintsPackage.REFERENCE_PROPERTY__VALUE: |
| if (resolve) { |
| return getValue(); |
| } |
| return basicGetValue(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ConstraintsPackage.REFERENCE_PROPERTY__VALUE: |
| setValue((EObject) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ConstraintsPackage.REFERENCE_PROPERTY__VALUE: |
| setValue((EObject) null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ConstraintsPackage.REFERENCE_PROPERTY__VALUE: |
| return value != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } // ReferencePropertyImpl |