| /* |
| * Copyright (c) 2014, 2018 CEA and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * Kenn Hussey (CEA) - initial API and implementation |
| * Kenn Hussey (CEA) - 451350 |
| * Kenn Hussey - 535301 |
| * |
| */ |
| package org.eclipse.uml2.uml.profile.standard.internal.impl; |
| |
| import java.lang.reflect.InvocationTargetException; |
| import java.util.Map; |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.common.util.DiagnosticChain; |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| |
| import org.eclipse.uml2.uml.Classifier; |
| |
| import org.eclipse.uml2.uml.profile.standard.Realization; |
| import org.eclipse.uml2.uml.profile.standard.StandardPackage; |
| import org.eclipse.uml2.uml.profile.standard.internal.operations.RealizationOperations; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Realization</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.uml2.uml.profile.standard.internal.impl.RealizationImpl#getBase_Classifier <em>Base Classifier</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class RealizationImpl |
| extends EObjectImpl |
| implements Realization { |
| |
| /** |
| * The cached value of the '{@link #getBase_Classifier() <em>Base Classifier</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBase_Classifier() |
| * @generated |
| * @ordered |
| */ |
| protected Classifier base_Classifier; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected RealizationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return StandardPackage.Literals.REALIZATION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Classifier getBase_Classifier() { |
| if (base_Classifier != null && base_Classifier.eIsProxy()) { |
| InternalEObject oldBase_Classifier = (InternalEObject) base_Classifier; |
| base_Classifier = (Classifier) eResolveProxy(oldBase_Classifier); |
| if (base_Classifier != oldBase_Classifier) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, |
| StandardPackage.REALIZATION__BASE_CLASSIFIER, |
| oldBase_Classifier, base_Classifier)); |
| } |
| } |
| return base_Classifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Classifier basicGetBase_Classifier() { |
| return base_Classifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setBase_Classifier(Classifier newBase_Classifier) { |
| Classifier oldBase_Classifier = base_Classifier; |
| base_Classifier = newBase_Classifier; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, |
| StandardPackage.REALIZATION__BASE_CLASSIFIER, |
| oldBase_Classifier, base_Classifier)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateCannotBeImplementationClass( |
| DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return RealizationOperations.validateCannotBeImplementationClass(this, |
| diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case StandardPackage.REALIZATION__BASE_CLASSIFIER : |
| if (resolve) |
| return getBase_Classifier(); |
| return basicGetBase_Classifier(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case StandardPackage.REALIZATION__BASE_CLASSIFIER : |
| setBase_Classifier((Classifier) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case StandardPackage.REALIZATION__BASE_CLASSIFIER : |
| setBase_Classifier((Classifier) null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case StandardPackage.REALIZATION__BASE_CLASSIFIER : |
| return base_Classifier != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| @SuppressWarnings("unchecked") |
| public Object eInvoke(int operationID, EList<?> arguments) |
| throws InvocationTargetException { |
| switch (operationID) { |
| case StandardPackage.REALIZATION___VALIDATE_CANNOT_BE_IMPLEMENTATION_CLASS__DIAGNOSTICCHAIN_MAP : |
| return validateCannotBeImplementationClass( |
| (DiagnosticChain) arguments.get(0), |
| (Map<Object, Object>) arguments.get(1)); |
| } |
| return super.eInvoke(operationID, arguments); |
| } |
| |
| } //RealizationImpl |