
BusinessDomainDsl.impl.EnumerationImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mod4j-businessdomain-mm Show documentation
Show all versions of mod4j-businessdomain-mm Show documentation
This Eclipse plug-in project contains the BusinessDomain meta model.
The newest version!
/**
*
*
*
* $Id$
*/
package BusinessDomainDsl.impl;
import BusinessDomainDsl.BusinessDomainDslPackage;
import BusinessDomainDsl.BusinessDomainModel;
import BusinessDomainDsl.Enumeration;
import BusinessDomainDsl.EnumerationLiteral;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Enumeration'.
*
*
* The following features are implemented:
*
* - {@link BusinessDomainDsl.impl.EnumerationImpl#getEnumerationLiterals Enumeration Literals}
* - {@link BusinessDomainDsl.impl.EnumerationImpl#getModel Model}
*
*
*
* @generated
*/
public class EnumerationImpl extends ModelElementImpl implements Enumeration {
/**
* The cached value of the '{@link #getEnumerationLiterals() Enumeration Literals}' containment reference list.
*
*
* @see #getEnumerationLiterals()
* @generated
* @ordered
*/
protected EList enumerationLiterals;
/**
*
*
* @generated
*/
protected EnumerationImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return BusinessDomainDslPackage.Literals.ENUMERATION;
}
/**
*
*
* @generated
*/
public EList getEnumerationLiterals() {
if (enumerationLiterals == null) {
enumerationLiterals = new EObjectContainmentWithInverseEList(EnumerationLiteral.class, this, BusinessDomainDslPackage.ENUMERATION__ENUMERATION_LITERALS, BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION);
}
return enumerationLiterals;
}
/**
*
*
* @generated
*/
public BusinessDomainModel getModel() {
if (eContainerFeatureID() != BusinessDomainDslPackage.ENUMERATION__MODEL) return null;
return (BusinessDomainModel)eContainer();
}
/**
*
*
* @generated
*/
public NotificationChain basicSetModel(BusinessDomainModel newModel, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject)newModel, BusinessDomainDslPackage.ENUMERATION__MODEL, msgs);
return msgs;
}
/**
*
*
* @generated
*/
public void setModel(BusinessDomainModel newModel) {
if (newModel != eInternalContainer() || (eContainerFeatureID() != BusinessDomainDslPackage.ENUMERATION__MODEL && newModel != null)) {
if (EcoreUtil.isAncestor(this, newModel))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newModel != null)
msgs = ((InternalEObject)newModel).eInverseAdd(this, BusinessDomainDslPackage.BUSINESS_DOMAIN_MODEL__ENUMERATIONS, BusinessDomainModel.class, msgs);
msgs = basicSetModel(newModel, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BusinessDomainDslPackage.ENUMERATION__MODEL, newModel, newModel));
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION__ENUMERATION_LITERALS:
return ((InternalEList)(InternalEList>)getEnumerationLiterals()).basicAdd(otherEnd, msgs);
case BusinessDomainDslPackage.ENUMERATION__MODEL:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetModel((BusinessDomainModel)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION__ENUMERATION_LITERALS:
return ((InternalEList>)getEnumerationLiterals()).basicRemove(otherEnd, msgs);
case BusinessDomainDslPackage.ENUMERATION__MODEL:
return basicSetModel(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case BusinessDomainDslPackage.ENUMERATION__MODEL:
return eInternalContainer().eInverseRemove(this, BusinessDomainDslPackage.BUSINESS_DOMAIN_MODEL__ENUMERATIONS, BusinessDomainModel.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION__ENUMERATION_LITERALS:
return getEnumerationLiterals();
case BusinessDomainDslPackage.ENUMERATION__MODEL:
return getModel();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION__ENUMERATION_LITERALS:
getEnumerationLiterals().clear();
getEnumerationLiterals().addAll((Collection extends EnumerationLiteral>)newValue);
return;
case BusinessDomainDslPackage.ENUMERATION__MODEL:
setModel((BusinessDomainModel)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION__ENUMERATION_LITERALS:
getEnumerationLiterals().clear();
return;
case BusinessDomainDslPackage.ENUMERATION__MODEL:
setModel((BusinessDomainModel)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION__ENUMERATION_LITERALS:
return enumerationLiterals != null && !enumerationLiterals.isEmpty();
case BusinessDomainDslPackage.ENUMERATION__MODEL:
return getModel() != null;
}
return super.eIsSet(featureID);
}
} //EnumerationImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy