blob: 27218603f7afc75aebe52b48fa3c05c7a41a84ca [file] [log] [blame]
/**
*/
package org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.ocl.xtext.basecs.impl.AnnotationCSImpl;
import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor;
import org.eclipse.ocl.xtext.essentialoclcs.ExpCS;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.PathName2CS;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.QVTOperationalCSPackage;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.TagCS;
import org.eclipse.qvto.examples.xtext.qvtoperationalcs.util.QVTOperationalCSVisitor;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Tag CS</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl.TagCSImpl#getOwnedElementPath <em>Owned Element Path</em>}</li>
* <li>{@link org.eclipse.qvto.examples.xtext.qvtoperationalcs.impl.TagCSImpl#getOwnedExpression <em>Owned Expression</em>}</li>
* </ul>
*
* @generated
*/
public class TagCSImpl extends AnnotationCSImpl implements TagCS {
/**
* The cached value of the '{@link #getOwnedElementPath() <em>Owned Element Path</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwnedElementPath()
* @generated
* @ordered
*/
protected PathName2CS ownedElementPath;
/**
* The cached value of the '{@link #getOwnedExpression() <em>Owned Expression</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwnedExpression()
* @generated
* @ordered
*/
protected ExpCS ownedExpression;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TagCSImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return QVTOperationalCSPackage.Literals.TAG_CS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PathName2CS getOwnedElementPath() {
return ownedElementPath;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOwnedElementPath(PathName2CS newOwnedElementPath, NotificationChain msgs) {
PathName2CS oldOwnedElementPath = ownedElementPath;
ownedElementPath = newOwnedElementPath;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.TAG_CS__OWNED_ELEMENT_PATH, oldOwnedElementPath, newOwnedElementPath);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOwnedElementPath(PathName2CS newOwnedElementPath) {
if (newOwnedElementPath != ownedElementPath) {
NotificationChain msgs = null;
if (ownedElementPath != null)
msgs = ((InternalEObject)ownedElementPath).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - QVTOperationalCSPackage.TAG_CS__OWNED_ELEMENT_PATH, null, msgs);
if (newOwnedElementPath != null)
msgs = ((InternalEObject)newOwnedElementPath).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - QVTOperationalCSPackage.TAG_CS__OWNED_ELEMENT_PATH, null, msgs);
msgs = basicSetOwnedElementPath(newOwnedElementPath, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.TAG_CS__OWNED_ELEMENT_PATH, newOwnedElementPath, newOwnedElementPath));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ExpCS getOwnedExpression() {
return ownedExpression;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOwnedExpression(ExpCS newOwnedExpression, NotificationChain msgs) {
ExpCS oldOwnedExpression = ownedExpression;
ownedExpression = newOwnedExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.TAG_CS__OWNED_EXPRESSION, oldOwnedExpression, newOwnedExpression);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOwnedExpression(ExpCS newOwnedExpression) {
if (newOwnedExpression != ownedExpression) {
NotificationChain msgs = null;
if (ownedExpression != null)
msgs = ((InternalEObject)ownedExpression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - QVTOperationalCSPackage.TAG_CS__OWNED_EXPRESSION, null, msgs);
if (newOwnedExpression != null)
msgs = ((InternalEObject)newOwnedExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - QVTOperationalCSPackage.TAG_CS__OWNED_EXPRESSION, null, msgs);
msgs = basicSetOwnedExpression(newOwnedExpression, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, QVTOperationalCSPackage.TAG_CS__OWNED_EXPRESSION, newOwnedExpression, newOwnedExpression));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case QVTOperationalCSPackage.TAG_CS__OWNED_ELEMENT_PATH:
return basicSetOwnedElementPath(null, msgs);
case QVTOperationalCSPackage.TAG_CS__OWNED_EXPRESSION:
return basicSetOwnedExpression(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case QVTOperationalCSPackage.TAG_CS__OWNED_ELEMENT_PATH:
return getOwnedElementPath();
case QVTOperationalCSPackage.TAG_CS__OWNED_EXPRESSION:
return getOwnedExpression();
}
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.TAG_CS__OWNED_ELEMENT_PATH:
setOwnedElementPath((PathName2CS)newValue);
return;
case QVTOperationalCSPackage.TAG_CS__OWNED_EXPRESSION:
setOwnedExpression((ExpCS)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case QVTOperationalCSPackage.TAG_CS__OWNED_ELEMENT_PATH:
setOwnedElementPath((PathName2CS)null);
return;
case QVTOperationalCSPackage.TAG_CS__OWNED_EXPRESSION:
setOwnedExpression((ExpCS)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case QVTOperationalCSPackage.TAG_CS__OWNED_ELEMENT_PATH:
return ownedElementPath != null;
case QVTOperationalCSPackage.TAG_CS__OWNED_EXPRESSION:
return ownedExpression != null;
}
return super.eIsSet(featureID);
}
/**
* {@inheritDoc}
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public <R> R accept(BaseCSVisitor<R> visitor) {
return (R) ((QVTOperationalCSVisitor<?>)visitor).visitTagCS(this);
}
} //TagCSImpl