/** */ package de.gebit.integrity.dsl.impl; import de.gebit.integrity.dsl.DslPackage; import de.gebit.integrity.dsl.MethodReference; 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; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.xtext.common.types.JvmOperation; import org.eclipse.xtext.common.types.JvmType; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Method Reference</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link de.gebit.integrity.dsl.impl.MethodReferenceImpl#getType <em>Type</em>}</li> * <li>{@link de.gebit.integrity.dsl.impl.MethodReferenceImpl#getMethod <em>Method</em>}</li> * </ul> * * @generated */ public class MethodReferenceImpl extends MinimalEObjectImpl.Container implements MethodReference { /** * The cached value of the '{@link #getType() <em>Type</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected JvmType type; /** * The cached value of the '{@link #getMethod() <em>Method</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getMethod() * @generated * @ordered */ protected JvmOperation method; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected MethodReferenceImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DslPackage.Literals.METHOD_REFERENCE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public JvmType getType() { if (type != null && type.eIsProxy()) { InternalEObject oldType = (InternalEObject)type; type = (JvmType)eResolveProxy(oldType); if (type != oldType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, DslPackage.METHOD_REFERENCE__TYPE, oldType, type)); } } return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public JvmType basicGetType() { return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setType(JvmType newType) { JvmType oldType = type; type = newType; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DslPackage.METHOD_REFERENCE__TYPE, oldType, type)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public JvmOperation getMethod() { if (method != null && method.eIsProxy()) { InternalEObject oldMethod = (InternalEObject)method; method = (JvmOperation)eResolveProxy(oldMethod); if (method != oldMethod) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, DslPackage.METHOD_REFERENCE__METHOD, oldMethod, method)); } } return method; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public JvmOperation basicGetMethod() { return method; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setMethod(JvmOperation newMethod) { JvmOperation oldMethod = method; method = newMethod; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DslPackage.METHOD_REFERENCE__METHOD, oldMethod, method)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DslPackage.METHOD_REFERENCE__TYPE: if (resolve) return getType(); return basicGetType(); case DslPackage.METHOD_REFERENCE__METHOD: if (resolve) return getMethod(); return basicGetMethod(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DslPackage.METHOD_REFERENCE__TYPE: setType((JvmType)newValue); return; case DslPackage.METHOD_REFERENCE__METHOD: setMethod((JvmOperation)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DslPackage.METHOD_REFERENCE__TYPE: setType((JvmType)null); return; case DslPackage.METHOD_REFERENCE__METHOD: setMethod((JvmOperation)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DslPackage.METHOD_REFERENCE__TYPE: return type != null; case DslPackage.METHOD_REFERENCE__METHOD: return method != null; } return super.eIsSet(featureID); } } //MethodReferenceImpl