blob: 7f8420f07cd12a16b6360926d4194d86a52908b0 [file] [log] [blame]
/*
* Copyright (c) 2014 CEA 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:
* Kenn Hussey (CEA) - initial API and implementation
*
*/
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.Component;
import org.eclipse.uml2.uml.profile.standard.Implement;
import org.eclipse.uml2.uml.profile.standard.StandardPackage;
import org.eclipse.uml2.uml.profile.standard.internal.operations.ImplementOperations;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Implement</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.uml2.uml.profile.standard.internal.impl.ImplementImpl#getBase_Component <em>Base Component</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ImplementImpl
extends EObjectImpl
implements Implement {
/**
* The cached value of the '{@link #getBase_Component() <em>Base Component</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_Component()
* @generated
* @ordered
*/
protected Component base_Component;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ImplementImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return StandardPackage.Literals.IMPLEMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Component getBase_Component() {
if (base_Component != null && base_Component.eIsProxy()) {
InternalEObject oldBase_Component = (InternalEObject) base_Component;
base_Component = (Component) eResolveProxy(oldBase_Component);
if (base_Component != oldBase_Component) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
StandardPackage.IMPLEMENT__BASE_COMPONENT,
oldBase_Component, base_Component));
}
}
return base_Component;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Component basicGetBase_Component() {
return base_Component;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_Component(Component newBase_Component) {
Component oldBase_Component = base_Component;
base_Component = newBase_Component;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
StandardPackage.IMPLEMENT__BASE_COMPONENT, oldBase_Component,
base_Component));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateImplementsSpecification(DiagnosticChain diagnostics,
Map<Object, Object> context) {
return ImplementOperations.validateImplementsSpecification(this,
diagnostics, context);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case StandardPackage.IMPLEMENT__BASE_COMPONENT :
if (resolve)
return getBase_Component();
return basicGetBase_Component();
}
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.IMPLEMENT__BASE_COMPONENT :
setBase_Component((Component) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case StandardPackage.IMPLEMENT__BASE_COMPONENT :
setBase_Component((Component) null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case StandardPackage.IMPLEMENT__BASE_COMPONENT :
return base_Component != 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.IMPLEMENT___VALIDATE_IMPLEMENTS_SPECIFICATION__DIAGNOSTICCHAIN_MAP :
return validateImplementsSpecification(
(DiagnosticChain) arguments.get(0),
(Map<Object, Object>) arguments.get(1));
}
return super.eInvoke(operationID, arguments);
}
} //ImplementImpl