/** | |
* Copyright (c) 2009-2010 Thales Corporate Services S.A.S. | |
* 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 | |
* https://www.eclipse.org/legal/epl-v2.0 | |
* | |
* SPDX-License-Identifier: EPL-2.0 | |
* | |
* Contributors: | |
* Thales Corporate Services S.A.S - initial API and implementation | |
*/ | |
package org.eclipse.egf.model.pattern.impl; | |
import org.eclipse.egf.model.pattern.InjectedContext; | |
import org.eclipse.egf.model.pattern.PatternInjectedCall; | |
import org.eclipse.egf.model.pattern.PatternPackage; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.InternalEObject; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Injected Call</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.egf.model.pattern.impl.PatternInjectedCallImpl#getContext <em>Context</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class PatternInjectedCallImpl extends AbstractPatternCallImpl implements PatternInjectedCall { | |
/** | |
* The cached value of the '{@link #getContext() <em>Context</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getContext() | |
* @generated | |
* @ordered | |
*/ | |
protected InjectedContext context; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected PatternInjectedCallImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return PatternPackage.Literals.PATTERN_INJECTED_CALL; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public InjectedContext getContext() { | |
if (context != null && context.eIsProxy()) { | |
InternalEObject oldContext = (InternalEObject) context; | |
context = (InjectedContext) eResolveProxy(oldContext); | |
if (context != oldContext) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PatternPackage.PATTERN_INJECTED_CALL__CONTEXT, oldContext, context)); | |
} | |
} | |
return context; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public InjectedContext basicGetContext() { | |
return context; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setContext(InjectedContext newContext) { | |
InjectedContext oldContext = context; | |
context = newContext; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, PatternPackage.PATTERN_INJECTED_CALL__CONTEXT, oldContext, context)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case PatternPackage.PATTERN_INJECTED_CALL__CONTEXT: | |
if (resolve) | |
return getContext(); | |
return basicGetContext(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case PatternPackage.PATTERN_INJECTED_CALL__CONTEXT: | |
setContext((InjectedContext) newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case PatternPackage.PATTERN_INJECTED_CALL__CONTEXT: | |
setContext((InjectedContext) null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case PatternPackage.PATTERN_INJECTED_CALL__CONTEXT: | |
return context != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} // PatternInjectedCallImpl |