| /******************************************************************************* |
| * Copyright (c) 2001, 2005 IBM Corporation 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: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.jem.internal.beaninfo.impl; |
| /* |
| |
| |
| */ |
| |
| |
| 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.EOperationImpl; |
| |
| import org.eclipse.jem.internal.beaninfo.BeaninfoPackage; |
| import org.eclipse.jem.internal.beaninfo.MethodProxy; |
| import org.eclipse.jem.java.Method; |
| |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Method Proxy</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.jem.internal.beaninfo.impl.MethodProxyImpl#getMethod <em>Method</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| |
| |
| public class MethodProxyImpl extends EOperationImpl implements MethodProxy { |
| /** |
| * The cached value of the '{@link #getMethod() <em>Method</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMethod() |
| * @generated |
| * @ordered |
| */ |
| protected Method method = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected MethodProxyImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return BeaninfoPackage.Literals.METHOD_PROXY; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Method getMethod() { |
| if (method != null && method.eIsProxy()) { |
| InternalEObject oldMethod = (InternalEObject)method; |
| method = (Method)eResolveProxy(oldMethod); |
| if (method != oldMethod) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, BeaninfoPackage.METHOD_PROXY__METHOD, oldMethod, method)); |
| } |
| } |
| return method; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Method basicGetMethod() { |
| return method; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMethod(Method newMethod) { |
| Method oldMethod = method; |
| method = newMethod; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, BeaninfoPackage.METHOD_PROXY__METHOD, oldMethod, method)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case BeaninfoPackage.METHOD_PROXY__METHOD: |
| if (resolve) return getMethod(); |
| return basicGetMethod(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case BeaninfoPackage.METHOD_PROXY__METHOD: |
| setMethod((Method)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case BeaninfoPackage.METHOD_PROXY__METHOD: |
| setMethod((Method)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case BeaninfoPackage.METHOD_PROXY__METHOD: |
| return method != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } |