
sculptormetamodel.impl.ModuleImpl Maven / Gradle / Ivy
/**
*/
package sculptormetamodel.impl;
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;
import sculptormetamodel.Application;
import sculptormetamodel.Consumer;
import sculptormetamodel.DomainObject;
import sculptormetamodel.Module;
import sculptormetamodel.Resource;
import sculptormetamodel.SculptormetamodelPackage;
import sculptormetamodel.Service;
/**
*
* An implementation of the model object 'Module'.
*
*
* The following features are implemented:
*
* - {@link sculptormetamodel.impl.ModuleImpl#getBasePackage Base Package}
* - {@link sculptormetamodel.impl.ModuleImpl#getApplication Application}
* - {@link sculptormetamodel.impl.ModuleImpl#getDomainObjects Domain Objects}
* - {@link sculptormetamodel.impl.ModuleImpl#getConsumers Consumers}
* - {@link sculptormetamodel.impl.ModuleImpl#getServices Services}
* - {@link sculptormetamodel.impl.ModuleImpl#isExternal External}
* - {@link sculptormetamodel.impl.ModuleImpl#getPersistenceUnit Persistence Unit}
* - {@link sculptormetamodel.impl.ModuleImpl#getResources Resources}
*
*
*
* @generated
*/
public class ModuleImpl extends NamedElementImpl implements Module
{
/**
* The default value of the '{@link #getBasePackage() Base Package}' attribute.
*
*
* @see #getBasePackage()
* @generated
* @ordered
*/
protected static final String BASE_PACKAGE_EDEFAULT = null;
/**
* The cached value of the '{@link #getBasePackage() Base Package}' attribute.
*
*
* @see #getBasePackage()
* @generated
* @ordered
*/
protected String basePackage = BASE_PACKAGE_EDEFAULT;
/**
* The cached value of the '{@link #getDomainObjects() Domain Objects}' containment reference list.
*
*
* @see #getDomainObjects()
* @generated
* @ordered
*/
protected EList domainObjects;
/**
* The cached value of the '{@link #getConsumers() Consumers}' containment reference list.
*
*
* @see #getConsumers()
* @generated
* @ordered
*/
protected EList consumers;
/**
* The cached value of the '{@link #getServices() Services}' containment reference list.
*
*
* @see #getServices()
* @generated
* @ordered
*/
protected EList services;
/**
* The default value of the '{@link #isExternal() External}' attribute.
*
*
* @see #isExternal()
* @generated
* @ordered
*/
protected static final boolean EXTERNAL_EDEFAULT = false;
/**
* The cached value of the '{@link #isExternal() External}' attribute.
*
*
* @see #isExternal()
* @generated
* @ordered
*/
protected boolean external = EXTERNAL_EDEFAULT;
/**
* The default value of the '{@link #getPersistenceUnit() Persistence Unit}' attribute.
*
*
* @see #getPersistenceUnit()
* @generated
* @ordered
*/
protected static final String PERSISTENCE_UNIT_EDEFAULT = null;
/**
* The cached value of the '{@link #getPersistenceUnit() Persistence Unit}' attribute.
*
*
* @see #getPersistenceUnit()
* @generated
* @ordered
*/
protected String persistenceUnit = PERSISTENCE_UNIT_EDEFAULT;
/**
* The cached value of the '{@link #getResources() Resources}' containment reference list.
*
*
* @see #getResources()
* @generated
* @ordered
*/
protected EList resources;
/**
*
*
* @generated
*/
protected ModuleImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SculptormetamodelPackage.Literals.MODULE;
}
/**
*
*
* @generated
*/
public String getBasePackage()
{
return basePackage;
}
/**
*
*
* @generated
*/
public void setBasePackage(String newBasePackage)
{
String oldBasePackage = basePackage;
basePackage = newBasePackage;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SculptormetamodelPackage.MODULE__BASE_PACKAGE, oldBasePackage, basePackage));
}
/**
*
*
* @generated
*/
public Application getApplication()
{
if (eContainerFeatureID() != SculptormetamodelPackage.MODULE__APPLICATION) return null;
return (Application)eInternalContainer();
}
/**
*
*
* @generated
*/
public NotificationChain basicSetApplication(Application newApplication, NotificationChain msgs)
{
msgs = eBasicSetContainer((InternalEObject)newApplication, SculptormetamodelPackage.MODULE__APPLICATION, msgs);
return msgs;
}
/**
*
*
* @generated
*/
public void setApplication(Application newApplication)
{
if (newApplication != eInternalContainer() || (eContainerFeatureID() != SculptormetamodelPackage.MODULE__APPLICATION && newApplication != null))
{
if (EcoreUtil.isAncestor(this, newApplication))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newApplication != null)
msgs = ((InternalEObject)newApplication).eInverseAdd(this, SculptormetamodelPackage.APPLICATION__MODULES, Application.class, msgs);
msgs = basicSetApplication(newApplication, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SculptormetamodelPackage.MODULE__APPLICATION, newApplication, newApplication));
}
/**
*
*
* @generated
*/
public EList getDomainObjects()
{
if (domainObjects == null)
{
domainObjects = new EObjectContainmentWithInverseEList(DomainObject.class, this, SculptormetamodelPackage.MODULE__DOMAIN_OBJECTS, SculptormetamodelPackage.DOMAIN_OBJECT__MODULE);
}
return domainObjects;
}
/**
*
*
* @generated
*/
public EList getConsumers()
{
if (consumers == null)
{
consumers = new EObjectContainmentWithInverseEList(Consumer.class, this, SculptormetamodelPackage.MODULE__CONSUMERS, SculptormetamodelPackage.CONSUMER__MODULE);
}
return consumers;
}
/**
*
*
* @generated
*/
public EList getServices()
{
if (services == null)
{
services = new EObjectContainmentWithInverseEList(Service.class, this, SculptormetamodelPackage.MODULE__SERVICES, SculptormetamodelPackage.SERVICE__MODULE);
}
return services;
}
/**
*
*
* @generated
*/
public boolean isExternal()
{
return external;
}
/**
*
*
* @generated
*/
public void setExternal(boolean newExternal)
{
boolean oldExternal = external;
external = newExternal;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SculptormetamodelPackage.MODULE__EXTERNAL, oldExternal, external));
}
/**
*
*
* @generated
*/
public String getPersistenceUnit()
{
return persistenceUnit;
}
/**
*
*
* @generated
*/
public void setPersistenceUnit(String newPersistenceUnit)
{
String oldPersistenceUnit = persistenceUnit;
persistenceUnit = newPersistenceUnit;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SculptormetamodelPackage.MODULE__PERSISTENCE_UNIT, oldPersistenceUnit, persistenceUnit));
}
/**
*
*
* @generated
*/
public EList getResources()
{
if (resources == null)
{
resources = new EObjectContainmentWithInverseEList(Resource.class, this, SculptormetamodelPackage.MODULE__RESOURCES, SculptormetamodelPackage.RESOURCE__MODULE);
}
return resources;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case SculptormetamodelPackage.MODULE__APPLICATION:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetApplication((Application)otherEnd, msgs);
case SculptormetamodelPackage.MODULE__DOMAIN_OBJECTS:
return ((InternalEList)(InternalEList>)getDomainObjects()).basicAdd(otherEnd, msgs);
case SculptormetamodelPackage.MODULE__CONSUMERS:
return ((InternalEList)(InternalEList>)getConsumers()).basicAdd(otherEnd, msgs);
case SculptormetamodelPackage.MODULE__SERVICES:
return ((InternalEList)(InternalEList>)getServices()).basicAdd(otherEnd, msgs);
case SculptormetamodelPackage.MODULE__RESOURCES:
return ((InternalEList)(InternalEList>)getResources()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case SculptormetamodelPackage.MODULE__APPLICATION:
return basicSetApplication(null, msgs);
case SculptormetamodelPackage.MODULE__DOMAIN_OBJECTS:
return ((InternalEList>)getDomainObjects()).basicRemove(otherEnd, msgs);
case SculptormetamodelPackage.MODULE__CONSUMERS:
return ((InternalEList>)getConsumers()).basicRemove(otherEnd, msgs);
case SculptormetamodelPackage.MODULE__SERVICES:
return ((InternalEList>)getServices()).basicRemove(otherEnd, msgs);
case SculptormetamodelPackage.MODULE__RESOURCES:
return ((InternalEList>)getResources()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs)
{
switch (eContainerFeatureID())
{
case SculptormetamodelPackage.MODULE__APPLICATION:
return eInternalContainer().eInverseRemove(this, SculptormetamodelPackage.APPLICATION__MODULES, Application.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case SculptormetamodelPackage.MODULE__BASE_PACKAGE:
return getBasePackage();
case SculptormetamodelPackage.MODULE__APPLICATION:
return getApplication();
case SculptormetamodelPackage.MODULE__DOMAIN_OBJECTS:
return getDomainObjects();
case SculptormetamodelPackage.MODULE__CONSUMERS:
return getConsumers();
case SculptormetamodelPackage.MODULE__SERVICES:
return getServices();
case SculptormetamodelPackage.MODULE__EXTERNAL:
return isExternal();
case SculptormetamodelPackage.MODULE__PERSISTENCE_UNIT:
return getPersistenceUnit();
case SculptormetamodelPackage.MODULE__RESOURCES:
return getResources();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case SculptormetamodelPackage.MODULE__BASE_PACKAGE:
setBasePackage((String)newValue);
return;
case SculptormetamodelPackage.MODULE__APPLICATION:
setApplication((Application)newValue);
return;
case SculptormetamodelPackage.MODULE__DOMAIN_OBJECTS:
getDomainObjects().clear();
getDomainObjects().addAll((Collection extends DomainObject>)newValue);
return;
case SculptormetamodelPackage.MODULE__CONSUMERS:
getConsumers().clear();
getConsumers().addAll((Collection extends Consumer>)newValue);
return;
case SculptormetamodelPackage.MODULE__SERVICES:
getServices().clear();
getServices().addAll((Collection extends Service>)newValue);
return;
case SculptormetamodelPackage.MODULE__EXTERNAL:
setExternal((Boolean)newValue);
return;
case SculptormetamodelPackage.MODULE__PERSISTENCE_UNIT:
setPersistenceUnit((String)newValue);
return;
case SculptormetamodelPackage.MODULE__RESOURCES:
getResources().clear();
getResources().addAll((Collection extends Resource>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case SculptormetamodelPackage.MODULE__BASE_PACKAGE:
setBasePackage(BASE_PACKAGE_EDEFAULT);
return;
case SculptormetamodelPackage.MODULE__APPLICATION:
setApplication((Application)null);
return;
case SculptormetamodelPackage.MODULE__DOMAIN_OBJECTS:
getDomainObjects().clear();
return;
case SculptormetamodelPackage.MODULE__CONSUMERS:
getConsumers().clear();
return;
case SculptormetamodelPackage.MODULE__SERVICES:
getServices().clear();
return;
case SculptormetamodelPackage.MODULE__EXTERNAL:
setExternal(EXTERNAL_EDEFAULT);
return;
case SculptormetamodelPackage.MODULE__PERSISTENCE_UNIT:
setPersistenceUnit(PERSISTENCE_UNIT_EDEFAULT);
return;
case SculptormetamodelPackage.MODULE__RESOURCES:
getResources().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SculptormetamodelPackage.MODULE__BASE_PACKAGE:
return BASE_PACKAGE_EDEFAULT == null ? basePackage != null : !BASE_PACKAGE_EDEFAULT.equals(basePackage);
case SculptormetamodelPackage.MODULE__APPLICATION:
return getApplication() != null;
case SculptormetamodelPackage.MODULE__DOMAIN_OBJECTS:
return domainObjects != null && !domainObjects.isEmpty();
case SculptormetamodelPackage.MODULE__CONSUMERS:
return consumers != null && !consumers.isEmpty();
case SculptormetamodelPackage.MODULE__SERVICES:
return services != null && !services.isEmpty();
case SculptormetamodelPackage.MODULE__EXTERNAL:
return external != EXTERNAL_EDEFAULT;
case SculptormetamodelPackage.MODULE__PERSISTENCE_UNIT:
return PERSISTENCE_UNIT_EDEFAULT == null ? persistenceUnit != null : !PERSISTENCE_UNIT_EDEFAULT.equals(persistenceUnit);
case SculptormetamodelPackage.MODULE__RESOURCES:
return resources != null && !resources.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (basePackage: ");
result.append(basePackage);
result.append(", external: ");
result.append(external);
result.append(", persistenceUnit: ");
result.append(persistenceUnit);
result.append(')');
return result.toString();
}
} //ModuleImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy