/** * Copyright (c) 2012 Obeo. * 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: * Obeo - initial API and implementation */ package org.eclipse.emf.compare.uml2.internal.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.compare.uml2.internal.StereotypeApplicationChange; import org.eclipse.emf.compare.uml2.internal.UMLComparePackage; import org.eclipse.emf.compare.uml2.internal.spec.UMLDiffSpec; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.uml2.uml.Stereotype; /** * <!-- begin-user-doc --> An implementation of the model object ' * <em><b>Stereotype Application Change</b></em>'. <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.emf.compare.uml2.internal.impl.StereotypeApplicationChangeImpl#getStereotype <em>Stereotype</em>}</li> * </ul> * </p> * * @generated */ public class StereotypeApplicationChangeImpl extends UMLDiffSpec implements StereotypeApplicationChange { /** * The cached value of the '{@link #getStereotype() <em>Stereotype</em>}' reference. * <!-- begin-user-doc * --> <!-- end-user-doc --> * @see #getStereotype() * @generated * @ordered */ protected Stereotype stereotype; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ protected StereotypeApplicationChangeImpl() { super(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return UMLComparePackage.Literals.STEREOTYPE_APPLICATION_CHANGE; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public Stereotype getStereotype() { if (stereotype != null && stereotype.eIsProxy()) { InternalEObject oldStereotype = (InternalEObject)stereotype; stereotype = (Stereotype)eResolveProxy(oldStereotype); if (stereotype != oldStereotype) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, UMLComparePackage.STEREOTYPE_APPLICATION_CHANGE__STEREOTYPE, oldStereotype, stereotype)); } } return stereotype; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public Stereotype basicGetStereotype() { return stereotype; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public void setStereotype(Stereotype newStereotype) { Stereotype oldStereotype = stereotype; stereotype = newStereotype; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, UMLComparePackage.STEREOTYPE_APPLICATION_CHANGE__STEREOTYPE, oldStereotype, stereotype)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case UMLComparePackage.STEREOTYPE_APPLICATION_CHANGE__STEREOTYPE: if (resolve) return getStereotype(); return basicGetStereotype(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case UMLComparePackage.STEREOTYPE_APPLICATION_CHANGE__STEREOTYPE: setStereotype((Stereotype)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case UMLComparePackage.STEREOTYPE_APPLICATION_CHANGE__STEREOTYPE: setStereotype((Stereotype)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case UMLComparePackage.STEREOTYPE_APPLICATION_CHANGE__STEREOTYPE: return stereotype != null; } return super.eIsSet(featureID); } } // StereotypeApplicationChangeImpl