/**
*/
package org.archstudio.xadl3.osgiimplementation_3_0.impl;
import java.util.Collection;
import org.archstudio.xadl3.implementation_3_0.impl.ImplementationImpl;
import org.archstudio.xadl3.osgiimplementation_3_0.OSGiImplementation;
import org.archstudio.xadl3.osgiimplementation_3_0.Osgiimplementation_3_0Package;
import org.archstudio.xadl3.xadlcore_3_0.Extension;
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.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>OS Gi Implementation</b></em>'. <!--
* end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.archstudio.xadl3.osgiimplementation_3_0.impl.OSGiImplementationImpl#getExt <em>Ext</em>}</li>
* <li>{@link org.archstudio.xadl3.osgiimplementation_3_0.impl.OSGiImplementationImpl#getBundle <em>Bundle</em>}</li>
* </ul>
*
* @generated
*/
public class OSGiImplementationImpl extends ImplementationImpl implements OSGiImplementation {
/**
* The cached value of the '{@link #getExt() <em>Ext</em>}' containment reference list. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getExt()
* @generated
* @ordered
*/
protected EList<Extension> ext;
/**
* The default value of the '{@link #getBundle() <em>Bundle</em>}' attribute. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getBundle()
* @generated
* @ordered
*/
protected static final String BUNDLE_EDEFAULT = null;
/**
* The cached value of the '{@link #getBundle() <em>Bundle</em>}' attribute. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getBundle()
* @generated
* @ordered
*/
protected String bundle = BUNDLE_EDEFAULT;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected OSGiImplementationImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Osgiimplementation_3_0Package.Literals.OS_GI_IMPLEMENTATION;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public EList<Extension> getExt() {
if (ext == null) {
ext = new EObjectContainmentEList<Extension>(Extension.class, this,
Osgiimplementation_3_0Package.OS_GI_IMPLEMENTATION__EXT);
}
return ext;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getBundle() {
return bundle;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setBundle(String newBundle) {
String oldBundle = bundle;
bundle = newBundle;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET,
Osgiimplementation_3_0Package.OS_GI_IMPLEMENTATION__BUNDLE, oldBundle, bundle));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Osgiimplementation_3_0Package.OS_GI_IMPLEMENTATION__EXT:
return ((InternalEList<?>) getExt()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Osgiimplementation_3_0Package.OS_GI_IMPLEMENTATION__EXT:
return getExt();
case Osgiimplementation_3_0Package.OS_GI_IMPLEMENTATION__BUNDLE:
return getBundle();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Osgiimplementation_3_0Package.OS_GI_IMPLEMENTATION__EXT:
getExt().clear();
getExt().addAll((Collection<? extends Extension>) newValue);
return;
case Osgiimplementation_3_0Package.OS_GI_IMPLEMENTATION__BUNDLE:
setBundle((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Osgiimplementation_3_0Package.OS_GI_IMPLEMENTATION__EXT:
getExt().clear();
return;
case Osgiimplementation_3_0Package.OS_GI_IMPLEMENTATION__BUNDLE:
setBundle(BUNDLE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Osgiimplementation_3_0Package.OS_GI_IMPLEMENTATION__EXT:
return ext != null && !ext.isEmpty();
case Osgiimplementation_3_0Package.OS_GI_IMPLEMENTATION__BUNDLE:
return BUNDLE_EDEFAULT == null ? bundle != null : !BUNDLE_EDEFAULT.equals(bundle);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) {
return super.toString();
}
StringBuffer result = new StringBuffer(super.toString());
result.append(" (bundle: ");
result.append(bundle);
result.append(')');
return result.toString();
}
} // OSGiImplementationImpl