/**
* generated by Xtext 2.10.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#getName Name}
* - {@link hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl.MetamodelDeclarationImpl#getSpecification Specification}
*
*
* @generated
*/
public class MetamodelDeclarationImpl extends DeclarationImpl implements MetamodelDeclaration
{
/**
* The default value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* 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
*/
public String getName()
{
return name;
}
/**
*
*
* @generated
*/
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ApplicationConfigurationPackage.METAMODEL_DECLARATION__NAME, oldName, name));
}
/**
*
*
* @generated
*/
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
*/
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__NAME:
return getName();
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__NAME:
setName((String)newValue);
return;
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__NAME:
setName(NAME_EDEFAULT);
return;
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__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case ApplicationConfigurationPackage.METAMODEL_DECLARATION__SPECIFICATION:
return specification != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //MetamodelDeclarationImpl