/**
* generated by Xtext 2.21.0
*/
package hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelDeclaration;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelSpecification;
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;
/**
*
* An implementation of the model object 'Metamodel Declaration'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl.MetamodelDeclarationImpl#getSpecification Specification}
*
*
* @generated
*/
public class MetamodelDeclarationImpl extends DeclarationImpl implements MetamodelDeclaration
{
/**
* The cached value of the '{@link #getSpecification() Specification}' containment reference.
*
*
* @see #getSpecification()
* @generated
* @ordered
*/
protected MetamodelSpecification specification;
/**
*
*
* @generated
*/
protected MetamodelDeclarationImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return ApplicationConfigurationPackage.Literals.METAMODEL_DECLARATION;
}
/**
*
*
* @generated
*/
@Override
public MetamodelSpecification getSpecification()
{
return specification;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetSpecification(MetamodelSpecification newSpecification, NotificationChain msgs)
{
MetamodelSpecification oldSpecification = specification;
specification = newSpecification;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ApplicationConfigurationPackage.METAMODEL_DECLARATION__SPECIFICATION, oldSpecification, newSpecification);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setSpecification(MetamodelSpecification newSpecification)
{
if (newSpecification != specification)
{
NotificationChain msgs = null;
if (specification != null)
msgs = ((InternalEObject)specification).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ApplicationConfigurationPackage.METAMODEL_DECLARATION__SPECIFICATION, null, msgs);
if (newSpecification != null)
msgs = ((InternalEObject)newSpecification).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ApplicationConfigurationPackage.METAMODEL_DECLARATION__SPECIFICATION, null, msgs);
msgs = basicSetSpecification(newSpecification, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ApplicationConfigurationPackage.METAMODEL_DECLARATION__SPECIFICATION, newSpecification, newSpecification));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case ApplicationConfigurationPackage.METAMODEL_DECLARATION__SPECIFICATION:
return basicSetSpecification(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case ApplicationConfigurationPackage.METAMODEL_DECLARATION__SPECIFICATION:
return getSpecification();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case ApplicationConfigurationPackage.METAMODEL_DECLARATION__SPECIFICATION:
setSpecification((MetamodelSpecification)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case ApplicationConfigurationPackage.METAMODEL_DECLARATION__SPECIFICATION:
setSpecification((MetamodelSpecification)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case ApplicationConfigurationPackage.METAMODEL_DECLARATION__SPECIFICATION:
return specification != null;
}
return super.eIsSet(featureID);
}
} //MetamodelDeclarationImpl