/**
*/
package org.xtext.guicemodules.guiceModules.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.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.xtext.common.types.JvmTypeReference;
import org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotation;
import org.xtext.guicemodules.guiceModules.GuiceModulesPackage;
import org.xtext.guicemodules.guiceModules.KeyAST;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Key AST</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.xtext.guicemodules.guiceModules.impl.KeyASTImpl#getAnnotation <em>Annotation</em>}</li>
* <li>{@link org.xtext.guicemodules.guiceModules.impl.KeyASTImpl#getType <em>Type</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class KeyASTImpl extends MinimalEObjectImpl.Container implements KeyAST
{
/**
* The cached value of the '{@link #getAnnotation() <em>Annotation</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAnnotation()
* @generated
* @ordered
*/
protected XAnnotation annotation;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected JvmTypeReference type;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected KeyASTImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GuiceModulesPackage.Literals.KEY_AST;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public XAnnotation getAnnotation()
{
return annotation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAnnotation(XAnnotation newAnnotation, NotificationChain msgs)
{
XAnnotation oldAnnotation = annotation;
annotation = newAnnotation;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GuiceModulesPackage.KEY_AST__ANNOTATION, oldAnnotation, newAnnotation);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAnnotation(XAnnotation newAnnotation)
{
if (newAnnotation != annotation)
{
NotificationChain msgs = null;
if (annotation != null)
msgs = ((InternalEObject)annotation).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GuiceModulesPackage.KEY_AST__ANNOTATION, null, msgs);
if (newAnnotation != null)
msgs = ((InternalEObject)newAnnotation).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GuiceModulesPackage.KEY_AST__ANNOTATION, null, msgs);
msgs = basicSetAnnotation(newAnnotation, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GuiceModulesPackage.KEY_AST__ANNOTATION, newAnnotation, newAnnotation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public JvmTypeReference getType()
{
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetType(JvmTypeReference newType, NotificationChain msgs)
{
JvmTypeReference oldType = type;
type = newType;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GuiceModulesPackage.KEY_AST__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(JvmTypeReference newType)
{
if (newType != type)
{
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GuiceModulesPackage.KEY_AST__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GuiceModulesPackage.KEY_AST__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GuiceModulesPackage.KEY_AST__TYPE, newType, newType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case GuiceModulesPackage.KEY_AST__ANNOTATION:
return basicSetAnnotation(null, msgs);
case GuiceModulesPackage.KEY_AST__TYPE:
return basicSetType(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 GuiceModulesPackage.KEY_AST__ANNOTATION:
return getAnnotation();
case GuiceModulesPackage.KEY_AST__TYPE:
return getType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case GuiceModulesPackage.KEY_AST__ANNOTATION:
setAnnotation((XAnnotation)newValue);
return;
case GuiceModulesPackage.KEY_AST__TYPE:
setType((JvmTypeReference)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case GuiceModulesPackage.KEY_AST__ANNOTATION:
setAnnotation((XAnnotation)null);
return;
case GuiceModulesPackage.KEY_AST__TYPE:
setType((JvmTypeReference)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case GuiceModulesPackage.KEY_AST__ANNOTATION:
return annotation != null;
case GuiceModulesPackage.KEY_AST__TYPE:
return type != null;
}
return super.eIsSet(featureID);
}
} //KeyASTImpl