/** * <copyright> * Copyright (c) 2008, 2009 Open Canarias S.L. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * A. Sanchez-Barbudo - initial API and implementation * </copyright> * * $Id: RaiseExpImpl.java,v 1.3 2009/02/06 15:47:30 radvorak Exp $ */ package org.eclipse.m2m.qvt.oml.ecore.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.EClassifier; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.ImperativeOCLPackage; import org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.RaiseExp; import org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.util.ImperativeOCLVisitor; import org.eclipse.ocl.ecore.OCLExpression; import org.eclipse.ocl.utilities.Visitor; /** * <!-- 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.ecore.ImperativeOCL.impl.RaiseExpImpl#getArgument <em>Argument</em>}</li> * <li>{@link org.eclipse.m2m.qvt.oml.ecore.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 EClassifier 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 EClassifier getException() { if (exception != null && exception.eIsProxy()) { InternalEObject oldException = (InternalEObject)exception; exception = (EClassifier)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 EClassifier basicGetException() { return exception; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setException(EClassifier newException) { EClassifier 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((EClassifier)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((EClassifier)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); } /** * @generated NOT */ @SuppressWarnings("unchecked") @Override public <T, U extends Visitor<T, ?, ?, ?, ?, ?, ?, ?, ?, ?>> T accept(U v) { if (v instanceof ImperativeOCLVisitor) return (T) ((ImperativeOCLVisitor) v).visitRaiseExp(this); return super.<T, U>accept(v); } } //RaiseExpImpl