
BusinessDomainDsl.impl.EnumerationLiteralImpl 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.Enumeration;
import BusinessDomainDsl.EnumerationLiteral;
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.util.EcoreUtil;
/**
*
* An implementation of the model object 'Enumeration Literal'.
*
*
* The following features are implemented:
*
* - {@link BusinessDomainDsl.impl.EnumerationLiteralImpl#getPersistedValue Persisted Value}
* - {@link BusinessDomainDsl.impl.EnumerationLiteralImpl#getEnumeration Enumeration}
*
*
*
* @generated
*/
public class EnumerationLiteralImpl extends ModelElementImpl implements EnumerationLiteral {
/**
* The default value of the '{@link #getPersistedValue() Persisted Value}' attribute.
*
*
* @see #getPersistedValue()
* @generated
* @ordered
*/
protected static final int PERSISTED_VALUE_EDEFAULT = 0;
/**
* The cached value of the '{@link #getPersistedValue() Persisted Value}' attribute.
*
*
* @see #getPersistedValue()
* @generated
* @ordered
*/
protected int persistedValue = PERSISTED_VALUE_EDEFAULT;
/**
*
*
* @generated
*/
protected EnumerationLiteralImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return BusinessDomainDslPackage.Literals.ENUMERATION_LITERAL;
}
/**
*
*
* @generated
*/
public int getPersistedValue() {
return persistedValue;
}
/**
*
*
* @generated
*/
public void setPersistedValue(int newPersistedValue) {
int oldPersistedValue = persistedValue;
persistedValue = newPersistedValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BusinessDomainDslPackage.ENUMERATION_LITERAL__PERSISTED_VALUE, oldPersistedValue, persistedValue));
}
/**
*
*
* @generated
*/
public Enumeration getEnumeration() {
if (eContainerFeatureID() != BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION) return null;
return (Enumeration)eContainer();
}
/**
*
*
* @generated
*/
public NotificationChain basicSetEnumeration(Enumeration newEnumeration, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject)newEnumeration, BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION, msgs);
return msgs;
}
/**
*
*
* @generated
*/
public void setEnumeration(Enumeration newEnumeration) {
if (newEnumeration != eInternalContainer() || (eContainerFeatureID() != BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION && newEnumeration != null)) {
if (EcoreUtil.isAncestor(this, newEnumeration))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newEnumeration != null)
msgs = ((InternalEObject)newEnumeration).eInverseAdd(this, BusinessDomainDslPackage.ENUMERATION__ENUMERATION_LITERALS, Enumeration.class, msgs);
msgs = basicSetEnumeration(newEnumeration, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION, newEnumeration, newEnumeration));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetEnumeration((Enumeration)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION:
return basicSetEnumeration(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION:
return eInternalContainer().eInverseRemove(this, BusinessDomainDslPackage.ENUMERATION__ENUMERATION_LITERALS, Enumeration.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION_LITERAL__PERSISTED_VALUE:
return getPersistedValue();
case BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION:
return getEnumeration();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION_LITERAL__PERSISTED_VALUE:
setPersistedValue((Integer)newValue);
return;
case BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION:
setEnumeration((Enumeration)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION_LITERAL__PERSISTED_VALUE:
setPersistedValue(PERSISTED_VALUE_EDEFAULT);
return;
case BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION:
setEnumeration((Enumeration)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BusinessDomainDslPackage.ENUMERATION_LITERAL__PERSISTED_VALUE:
return persistedValue != PERSISTED_VALUE_EDEFAULT;
case BusinessDomainDslPackage.ENUMERATION_LITERAL__ENUMERATION:
return getEnumeration() != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (persistedValue: ");
result.append(persistedValue);
result.append(')');
return result.toString();
}
} //EnumerationLiteralImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy