/** | |
* ******************************************************************************* | |
* Copyright (c) 2009 Mia-Software. | |
* 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: | |
* | |
* Fabien Giquel (Mia-Software) - initial API and implementation | |
* ******************************************************************************* | |
* | |
* $Id$ | |
*/ | |
package org.eclipse.gmt.modisco.java.emf.classic.impl; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.common.notify.NotificationChain; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.InternalEObject; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.gmt.modisco.java.PackageAccess; | |
import org.eclipse.gmt.modisco.java.emf.classic.JavaPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Package Access</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.gmt.modisco.java.emf.classic.impl.PackageAccessImpl#getPackage <em>Package</em>}</li> | |
* <li>{@link org.eclipse.gmt.modisco.java.emf.classic.impl.PackageAccessImpl#getQualifier <em>Qualifier</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class PackageAccessImpl extends NamespaceAccessImpl implements PackageAccess { | |
/** | |
* The cached value of the '{@link #getPackage() <em>Package</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getPackage() | |
* @generated | |
* @ordered | |
*/ | |
protected org.eclipse.gmt.modisco.java.Package package_; | |
/** | |
* The cached value of the '{@link #getQualifier() <em>Qualifier</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getQualifier() | |
* @generated | |
* @ordered | |
*/ | |
protected PackageAccess qualifier; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected PackageAccessImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return JavaPackage.eINSTANCE.getPackageAccess(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public org.eclipse.gmt.modisco.java.Package getPackage() { | |
if (package_ != null && package_.eIsProxy()) { | |
InternalEObject oldPackage = (InternalEObject)package_; | |
package_ = (org.eclipse.gmt.modisco.java.Package)eResolveProxy(oldPackage); | |
if (package_ != oldPackage) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.PACKAGE_ACCESS__PACKAGE, oldPackage, package_)); | |
} | |
} | |
return package_; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public org.eclipse.gmt.modisco.java.Package basicGetPackage() { | |
return package_; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetPackage(org.eclipse.gmt.modisco.java.Package newPackage, NotificationChain msgs) { | |
org.eclipse.gmt.modisco.java.Package oldPackage = package_; | |
package_ = newPackage; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JavaPackage.PACKAGE_ACCESS__PACKAGE, oldPackage, newPackage); | |
if (msgs == null) msgs = notification; else msgs.add(notification); | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setPackage(org.eclipse.gmt.modisco.java.Package newPackage) { | |
if (newPackage != package_) { | |
NotificationChain msgs = null; | |
if (package_ != null) | |
msgs = ((InternalEObject)package_).eInverseRemove(this, JavaPackage.PACKAGE__USAGES_IN_PACKAGE_ACCESS, org.eclipse.gmt.modisco.java.Package.class, msgs); | |
if (newPackage != null) | |
msgs = ((InternalEObject)newPackage).eInverseAdd(this, JavaPackage.PACKAGE__USAGES_IN_PACKAGE_ACCESS, org.eclipse.gmt.modisco.java.Package.class, msgs); | |
msgs = basicSetPackage(newPackage, msgs); | |
if (msgs != null) msgs.dispatch(); | |
} | |
else if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.PACKAGE_ACCESS__PACKAGE, newPackage, newPackage)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public PackageAccess getQualifier() { | |
return qualifier; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetQualifier(PackageAccess newQualifier, NotificationChain msgs) { | |
PackageAccess oldQualifier = qualifier; | |
qualifier = newQualifier; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JavaPackage.PACKAGE_ACCESS__QUALIFIER, oldQualifier, newQualifier); | |
if (msgs == null) msgs = notification; else msgs.add(notification); | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setQualifier(PackageAccess newQualifier) { | |
if (newQualifier != qualifier) { | |
NotificationChain msgs = null; | |
if (qualifier != null) | |
msgs = ((InternalEObject)qualifier).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JavaPackage.PACKAGE_ACCESS__QUALIFIER, null, msgs); | |
if (newQualifier != null) | |
msgs = ((InternalEObject)newQualifier).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JavaPackage.PACKAGE_ACCESS__QUALIFIER, null, msgs); | |
msgs = basicSetQualifier(newQualifier, msgs); | |
if (msgs != null) msgs.dispatch(); | |
} | |
else if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.PACKAGE_ACCESS__QUALIFIER, newQualifier, newQualifier)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case JavaPackage.PACKAGE_ACCESS__PACKAGE: | |
if (package_ != null) | |
msgs = ((InternalEObject)package_).eInverseRemove(this, JavaPackage.PACKAGE__USAGES_IN_PACKAGE_ACCESS, org.eclipse.gmt.modisco.java.Package.class, msgs); | |
return basicSetPackage((org.eclipse.gmt.modisco.java.Package)otherEnd, msgs); | |
} | |
return super.eInverseAdd(otherEnd, featureID, msgs); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case JavaPackage.PACKAGE_ACCESS__PACKAGE: | |
return basicSetPackage(null, msgs); | |
case JavaPackage.PACKAGE_ACCESS__QUALIFIER: | |
return basicSetQualifier(null, msgs); | |
} | |
return super.eInverseRemove(otherEnd, featureID, msgs); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case JavaPackage.PACKAGE_ACCESS__PACKAGE: | |
if (resolve) return getPackage(); | |
return basicGetPackage(); | |
case JavaPackage.PACKAGE_ACCESS__QUALIFIER: | |
return getQualifier(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case JavaPackage.PACKAGE_ACCESS__PACKAGE: | |
setPackage((org.eclipse.gmt.modisco.java.Package)newValue); | |
return; | |
case JavaPackage.PACKAGE_ACCESS__QUALIFIER: | |
setQualifier((PackageAccess)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case JavaPackage.PACKAGE_ACCESS__PACKAGE: | |
setPackage((org.eclipse.gmt.modisco.java.Package)null); | |
return; | |
case JavaPackage.PACKAGE_ACCESS__QUALIFIER: | |
setQualifier((PackageAccess)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case JavaPackage.PACKAGE_ACCESS__PACKAGE: | |
return package_ != null; | |
case JavaPackage.PACKAGE_ACCESS__QUALIFIER: | |
return qualifier != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} //PackageAccessImpl |