/******************************************************************************* * Copyright (c) 2008, 2011 Obeo. * 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: * Obeo - initial API and implementation *******************************************************************************/ package org.eclipse.emf.eef.mapping.filters.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.eef.mapping.filters.FiltersPackage; import org.eclipse.emf.eef.mapping.filters.OnlyReferenceTypeFilter; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Only Reference Type Filter</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.emf.eef.mapping.filters.impl.OnlyReferenceTypeFilterImpl#getReference <em>Reference</em>}</li> * </ul> * </p> * * @generated */ public class OnlyReferenceTypeFilterImpl extends BusinessFilterImpl implements OnlyReferenceTypeFilter { /** * The cached value of the '{@link #getReference() <em>Reference</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getReference() * @generated * @ordered */ protected EReference reference; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected OnlyReferenceTypeFilterImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return FiltersPackage.Literals.ONLY_REFERENCE_TYPE_FILTER; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getReference() { if (reference != null && reference.eIsProxy()) { InternalEObject oldReference = (InternalEObject) reference; reference = (EReference) eResolveProxy(oldReference); if (reference != oldReference) { if (eNotificationRequired()) eNotify(new ENotificationImpl( this, Notification.RESOLVE, FiltersPackage.ONLY_REFERENCE_TYPE_FILTER__REFERENCE, oldReference, reference)); } } return reference; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference basicGetReference() { return reference; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setReference(EReference newReference) { EReference oldReference = reference; reference = newReference; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, FiltersPackage.ONLY_REFERENCE_TYPE_FILTER__REFERENCE, oldReference, reference)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case FiltersPackage.ONLY_REFERENCE_TYPE_FILTER__REFERENCE: if (resolve) return getReference(); return basicGetReference(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case FiltersPackage.ONLY_REFERENCE_TYPE_FILTER__REFERENCE: setReference((EReference) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case FiltersPackage.ONLY_REFERENCE_TYPE_FILTER__REFERENCE: setReference((EReference) null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case FiltersPackage.ONLY_REFERENCE_TYPE_FILTER__REFERENCE: return reference != null; } return super.eIsSet(featureID); } } //OnlyReferenceTypeFilterImpl