blob: cbf4efb115622f24b9def4955dfc6fccd9cc4860 [file] [log] [blame]
/**
* <copyright>
* </copyright>
*
* $Id: RaiseExpImpl.java,v 1.2 2009/01/25 23:11:18 radvorak Exp $
*/
package org.eclipse.m2m.qvt.oml.emof.ImperativeOCL.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.m2m.qvt.oml.emof.ImperativeOCL.ImperativeOCLPackage;
import org.eclipse.m2m.qvt.oml.emof.ImperativeOCL.RaiseExp;
import org.eclipse.qvt.declarative.emof.EMOF.Type;
import org.eclipse.qvt.declarative.emof.EssentialOCL.OclExpression;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Raise Exp</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.m2m.qvt.oml.emof.ImperativeOCL.impl.RaiseExpImpl#getArgument <em>Argument</em>}</li>
* <li>{@link org.eclipse.m2m.qvt.oml.emof.ImperativeOCL.impl.RaiseExpImpl#getException <em>Exception</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class RaiseExpImpl extends ImperativeExpressionImpl implements RaiseExp {
/**
* The cached value of the '{@link #getArgument() <em>Argument</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getArgument()
* @generated
* @ordered
*/
protected OclExpression argument;
/**
* The cached value of the '{@link #getException() <em>Exception</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getException()
* @generated
* @ordered
*/
protected Type exception;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RaiseExpImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ImperativeOCLPackage.Literals.RAISE_EXP;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OclExpression getArgument() {
return argument;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetArgument(OclExpression newArgument, NotificationChain msgs) {
OclExpression oldArgument = argument;
argument = newArgument;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ImperativeOCLPackage.RAISE_EXP__ARGUMENT, oldArgument, newArgument);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setArgument(OclExpression newArgument) {
if (newArgument != argument) {
NotificationChain msgs = null;
if (argument != null)
msgs = ((InternalEObject)argument).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ImperativeOCLPackage.RAISE_EXP__ARGUMENT, null, msgs);
if (newArgument != null)
msgs = ((InternalEObject)newArgument).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ImperativeOCLPackage.RAISE_EXP__ARGUMENT, null, msgs);
msgs = basicSetArgument(newArgument, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ImperativeOCLPackage.RAISE_EXP__ARGUMENT, newArgument, newArgument));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Type getException() {
if (exception != null && exception.eIsProxy()) {
InternalEObject oldException = (InternalEObject)exception;
exception = (Type)eResolveProxy(oldException);
if (exception != oldException) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ImperativeOCLPackage.RAISE_EXP__EXCEPTION, oldException, exception));
}
}
return exception;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Type basicGetException() {
return exception;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setException(Type newException) {
Type oldException = exception;
exception = newException;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ImperativeOCLPackage.RAISE_EXP__EXCEPTION, oldException, exception));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ImperativeOCLPackage.RAISE_EXP__ARGUMENT:
return basicSetArgument(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 ImperativeOCLPackage.RAISE_EXP__ARGUMENT:
return getArgument();
case ImperativeOCLPackage.RAISE_EXP__EXCEPTION:
if (resolve) return getException();
return basicGetException();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ImperativeOCLPackage.RAISE_EXP__ARGUMENT:
setArgument((OclExpression)newValue);
return;
case ImperativeOCLPackage.RAISE_EXP__EXCEPTION:
setException((Type)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ImperativeOCLPackage.RAISE_EXP__ARGUMENT:
setArgument((OclExpression)null);
return;
case ImperativeOCLPackage.RAISE_EXP__EXCEPTION:
setException((Type)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ImperativeOCLPackage.RAISE_EXP__ARGUMENT:
return argument != null;
case ImperativeOCLPackage.RAISE_EXP__EXCEPTION:
return exception != null;
}
return super.eIsSet(featureID);
}
} //RaiseExpImpl