| /** |
| */ |
| package org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.ocl.pivot.Element; |
| import org.eclipse.ocl.xtext.basecs.impl.PivotableElementCSImpl; |
| import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor; |
| import org.eclipse.qvto.examples.xtext.qvtoperationalcs.PathElement2CS; |
| import org.eclipse.qvto.examples.xtext.qvtoperationalcs.PathName2CS; |
| import org.eclipse.qvto.examples.xtext.qvtoperationalcs.QVTOperationalCSPackage; |
| import org.eclipse.qvto.examples.xtext.qvtoperationalcs.util.QVTOperationalCSVisitor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Path Element2 CS</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl.PathElement2CSImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl.PathElement2CSImpl#getOwningPathNameCS <em>Owning Path Name CS</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class PathElement2CSImpl extends PivotableElementCSImpl implements PathElement2CS { |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getOwningPathNameCS() <em>Owning Path Name CS</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOwningPathNameCS() |
| * @generated |
| * @ordered |
| */ |
| protected PathName2CS owningPathNameCS; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PathElement2CSImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return QVTOperationalCSPackage.Literals.PATH_ELEMENT2_CS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.PATH_ELEMENT2_CS__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PathName2CS getOwningPathNameCS() { |
| if (owningPathNameCS != null && owningPathNameCS.eIsProxy()) { |
| InternalEObject oldOwningPathNameCS = (InternalEObject)owningPathNameCS; |
| owningPathNameCS = (PathName2CS)eResolveProxy(oldOwningPathNameCS); |
| if (owningPathNameCS != oldOwningPathNameCS) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, QVTOperationalCSPackage.PATH_ELEMENT2_CS__OWNING_PATH_NAME_CS, oldOwningPathNameCS, owningPathNameCS)); |
| } |
| } |
| return owningPathNameCS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PathName2CS basicGetOwningPathNameCS() { |
| return owningPathNameCS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setOwningPathNameCS(PathName2CS newOwningPathNameCS) { |
| PathName2CS oldOwningPathNameCS = owningPathNameCS; |
| owningPathNameCS = newOwningPathNameCS; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.PATH_ELEMENT2_CS__OWNING_PATH_NAME_CS, oldOwningPathNameCS, owningPathNameCS)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String toString() { |
| return super.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.PATH_ELEMENT2_CS__NAME: |
| return getName(); |
| case QVTOperationalCSPackage.PATH_ELEMENT2_CS__OWNING_PATH_NAME_CS: |
| if (resolve) return getOwningPathNameCS(); |
| return basicGetOwningPathNameCS(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.PATH_ELEMENT2_CS__NAME: |
| setName((String)newValue); |
| return; |
| case QVTOperationalCSPackage.PATH_ELEMENT2_CS__OWNING_PATH_NAME_CS: |
| setOwningPathNameCS((PathName2CS)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.PATH_ELEMENT2_CS__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case QVTOperationalCSPackage.PATH_ELEMENT2_CS__OWNING_PATH_NAME_CS: |
| setOwningPathNameCS((PathName2CS)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case QVTOperationalCSPackage.PATH_ELEMENT2_CS__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case QVTOperationalCSPackage.PATH_ELEMENT2_CS__OWNING_PATH_NAME_CS: |
| return owningPathNameCS != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public <R> R accept(BaseCSVisitor<R> visitor) { |
| return (R) ((QVTOperationalCSVisitor<?>)visitor).visitPathElement2CS(this); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated NOT |
| */ |
| @Override |
| public Element getPivot() { |
| return null;// FIXME |
| } |
| } //PathElement2CSImpl |