/** | |
* ******************************************************************************* | |
* 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 v2.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v20.html | |
* | |
* Contributors: | |
* | |
* Fabien Giquel (Mia-Software) - initial API and implementation | |
* Gregoire DUPE (Mia-Software) - initial API and implementation | |
* ******************************************************************************* | |
* | |
* $Id$ | |
*/ | |
package org.eclipse.modisco.java.nousages.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.modisco.java.AbstractTypeQualifiedExpression; | |
import org.eclipse.modisco.java.TypeAccess; | |
import org.eclipse.modisco.java.nousages.meta.JavaPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Abstract Type Qualified Expression</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.modisco.java.nousages.impl.AbstractTypeQualifiedExpressionImpl#getQualifier <em>Qualifier</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public abstract class AbstractTypeQualifiedExpressionImpl extends ExpressionImpl implements AbstractTypeQualifiedExpression { | |
/** | |
* The cached value of the '{@link #getQualifier() <em>Qualifier</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getQualifier() | |
* @generated | |
* @ordered | |
*/ | |
protected TypeAccess qualifier; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected AbstractTypeQualifiedExpressionImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return JavaPackage.eINSTANCE.getAbstractTypeQualifiedExpression(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public TypeAccess getQualifier() { | |
return qualifier; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetQualifier(TypeAccess newQualifier, NotificationChain msgs) { | |
TypeAccess oldQualifier = qualifier; | |
qualifier = newQualifier; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JavaPackage.ABSTRACT_TYPE_QUALIFIED_EXPRESSION__QUALIFIER, oldQualifier, newQualifier); | |
if (msgs == null) msgs = notification; else msgs.add(notification); | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setQualifier(TypeAccess newQualifier) { | |
if (newQualifier != qualifier) { | |
NotificationChain msgs = null; | |
if (qualifier != null) | |
msgs = ((InternalEObject)qualifier).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JavaPackage.ABSTRACT_TYPE_QUALIFIED_EXPRESSION__QUALIFIER, null, msgs); | |
if (newQualifier != null) | |
msgs = ((InternalEObject)newQualifier).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JavaPackage.ABSTRACT_TYPE_QUALIFIED_EXPRESSION__QUALIFIER, null, msgs); | |
msgs = basicSetQualifier(newQualifier, msgs); | |
if (msgs != null) msgs.dispatch(); | |
} | |
else if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.ABSTRACT_TYPE_QUALIFIED_EXPRESSION__QUALIFIER, newQualifier, newQualifier)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case JavaPackage.ABSTRACT_TYPE_QUALIFIED_EXPRESSION__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.ABSTRACT_TYPE_QUALIFIED_EXPRESSION__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.ABSTRACT_TYPE_QUALIFIED_EXPRESSION__QUALIFIER: | |
setQualifier((TypeAccess)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case JavaPackage.ABSTRACT_TYPE_QUALIFIED_EXPRESSION__QUALIFIER: | |
setQualifier((TypeAccess)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case JavaPackage.ABSTRACT_TYPE_QUALIFIED_EXPRESSION__QUALIFIER: | |
return qualifier != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} //AbstractTypeQualifiedExpressionImpl |