/**
*/
package at.bestsolution.efxclipse.tooling.rrobot.model.bundle.impl;
import at.bestsolution.efxclipse.tooling.rrobot.model.bundle.BundlePackage;
import at.bestsolution.efxclipse.tooling.rrobot.model.bundle.FeaturePlugin;
import at.bestsolution.efxclipse.tooling.rrobot.model.task.BooleanExpression;
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.impl.EObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Feature Plugin</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link at.bestsolution.efxclipse.tooling.rrobot.model.bundle.impl.FeaturePluginImpl#getExcludeExpression <em>Exclude Expression</em>}</li>
* <li>{@link at.bestsolution.efxclipse.tooling.rrobot.model.bundle.impl.FeaturePluginImpl#getId <em>Id</em>}</li>
* <li>{@link at.bestsolution.efxclipse.tooling.rrobot.model.bundle.impl.FeaturePluginImpl#isUnpack <em>Unpack</em>}</li>
* <li>{@link at.bestsolution.efxclipse.tooling.rrobot.model.bundle.impl.FeaturePluginImpl#isFragment <em>Fragment</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class FeaturePluginImpl extends EObjectImpl implements FeaturePlugin {
/**
* The cached value of the '{@link #getExcludeExpression() <em>Exclude Expression</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExcludeExpression()
* @generated
* @ordered
*/
protected BooleanExpression excludeExpression;
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* The default value of the '{@link #isUnpack() <em>Unpack</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isUnpack()
* @generated
* @ordered
*/
protected static final boolean UNPACK_EDEFAULT = false;
/**
* The cached value of the '{@link #isUnpack() <em>Unpack</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isUnpack()
* @generated
* @ordered
*/
protected boolean unpack = UNPACK_EDEFAULT;
/**
* The default value of the '{@link #isFragment() <em>Fragment</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isFragment()
* @generated
* @ordered
*/
protected static final boolean FRAGMENT_EDEFAULT = false;
/**
* The cached value of the '{@link #isFragment() <em>Fragment</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isFragment()
* @generated
* @ordered
*/
protected boolean fragment = FRAGMENT_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected FeaturePluginImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BundlePackage.Literals.FEATURE_PLUGIN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(String newId) {
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BundlePackage.FEATURE_PLUGIN__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isUnpack() {
return unpack;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setUnpack(boolean newUnpack) {
boolean oldUnpack = unpack;
unpack = newUnpack;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BundlePackage.FEATURE_PLUGIN__UNPACK, oldUnpack, unpack));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isFragment() {
return fragment;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFragment(boolean newFragment) {
boolean oldFragment = fragment;
fragment = newFragment;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BundlePackage.FEATURE_PLUGIN__FRAGMENT, oldFragment, fragment));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BooleanExpression getExcludeExpression() {
return excludeExpression;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetExcludeExpression(BooleanExpression newExcludeExpression, NotificationChain msgs) {
BooleanExpression oldExcludeExpression = excludeExpression;
excludeExpression = newExcludeExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BundlePackage.FEATURE_PLUGIN__EXCLUDE_EXPRESSION, oldExcludeExpression, newExcludeExpression);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExcludeExpression(BooleanExpression newExcludeExpression) {
if (newExcludeExpression != excludeExpression) {
NotificationChain msgs = null;
if (excludeExpression != null)
msgs = ((InternalEObject)excludeExpression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BundlePackage.FEATURE_PLUGIN__EXCLUDE_EXPRESSION, null, msgs);
if (newExcludeExpression != null)
msgs = ((InternalEObject)newExcludeExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BundlePackage.FEATURE_PLUGIN__EXCLUDE_EXPRESSION, null, msgs);
msgs = basicSetExcludeExpression(newExcludeExpression, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BundlePackage.FEATURE_PLUGIN__EXCLUDE_EXPRESSION, newExcludeExpression, newExcludeExpression));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BundlePackage.FEATURE_PLUGIN__EXCLUDE_EXPRESSION:
return basicSetExcludeExpression(null, 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 BundlePackage.FEATURE_PLUGIN__EXCLUDE_EXPRESSION:
return getExcludeExpression();
case BundlePackage.FEATURE_PLUGIN__ID:
return getId();
case BundlePackage.FEATURE_PLUGIN__UNPACK:
return isUnpack();
case BundlePackage.FEATURE_PLUGIN__FRAGMENT:
return isFragment();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BundlePackage.FEATURE_PLUGIN__EXCLUDE_EXPRESSION:
setExcludeExpression((BooleanExpression)newValue);
return;
case BundlePackage.FEATURE_PLUGIN__ID:
setId((String)newValue);
return;
case BundlePackage.FEATURE_PLUGIN__UNPACK:
setUnpack((Boolean)newValue);
return;
case BundlePackage.FEATURE_PLUGIN__FRAGMENT:
setFragment((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BundlePackage.FEATURE_PLUGIN__EXCLUDE_EXPRESSION:
setExcludeExpression((BooleanExpression)null);
return;
case BundlePackage.FEATURE_PLUGIN__ID:
setId(ID_EDEFAULT);
return;
case BundlePackage.FEATURE_PLUGIN__UNPACK:
setUnpack(UNPACK_EDEFAULT);
return;
case BundlePackage.FEATURE_PLUGIN__FRAGMENT:
setFragment(FRAGMENT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BundlePackage.FEATURE_PLUGIN__EXCLUDE_EXPRESSION:
return excludeExpression != null;
case BundlePackage.FEATURE_PLUGIN__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case BundlePackage.FEATURE_PLUGIN__UNPACK:
return unpack != UNPACK_EDEFAULT;
case BundlePackage.FEATURE_PLUGIN__FRAGMENT:
return fragment != FRAGMENT_EDEFAULT;
}
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(" (id: ");
result.append(id);
result.append(", unpack: ");
result.append(unpack);
result.append(", fragment: ");
result.append(fragment);
result.append(')');
return result.toString();
}
} //FeaturePluginImpl