/** | |
* Copyright (c) 2010 Mia-Software. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v2.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v20.html | |
* | |
* Contributors: | |
* | |
* Nicolas Guyomar (Mia-Software) - initial API and implementation | |
*/ | |
package org.eclipse.modisco.jee.webapp.webapp30.impl; | |
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; | |
import org.eclipse.modisco.jee.webapp.webapp30.RespectBindingType; | |
import org.eclipse.modisco.jee.webapp.webapp30.TrueFalseType; | |
import org.eclipse.modisco.jee.webapp.webapp30.Webapp30Package; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Respect Binding Type</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.modisco.jee.webapp.webapp30.impl.RespectBindingTypeImpl#getEnabled <em>Enabled</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class RespectBindingTypeImpl extends EObjectImpl implements RespectBindingType { | |
/** | |
* The cached value of the '{@link #getEnabled() <em>Enabled</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getEnabled() | |
* @generated | |
* @ordered | |
*/ | |
protected TrueFalseType enabled; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected RespectBindingTypeImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return Webapp30Package.eINSTANCE.getRespectBindingType(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public TrueFalseType getEnabled() { | |
return enabled; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetEnabled(TrueFalseType newEnabled, NotificationChain msgs) { | |
TrueFalseType oldEnabled = enabled; | |
enabled = newEnabled; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Webapp30Package.RESPECT_BINDING_TYPE__ENABLED, oldEnabled, newEnabled); | |
if (msgs == null) msgs = notification; else msgs.add(notification); | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setEnabled(TrueFalseType newEnabled) { | |
if (newEnabled != enabled) { | |
NotificationChain msgs = null; | |
if (enabled != null) | |
msgs = ((InternalEObject)enabled).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Webapp30Package.RESPECT_BINDING_TYPE__ENABLED, null, msgs); | |
if (newEnabled != null) | |
msgs = ((InternalEObject)newEnabled).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Webapp30Package.RESPECT_BINDING_TYPE__ENABLED, null, msgs); | |
msgs = basicSetEnabled(newEnabled, msgs); | |
if (msgs != null) msgs.dispatch(); | |
} | |
else if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, Webapp30Package.RESPECT_BINDING_TYPE__ENABLED, newEnabled, newEnabled)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case Webapp30Package.RESPECT_BINDING_TYPE__ENABLED: | |
return basicSetEnabled(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 Webapp30Package.RESPECT_BINDING_TYPE__ENABLED: | |
return getEnabled(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case Webapp30Package.RESPECT_BINDING_TYPE__ENABLED: | |
setEnabled((TrueFalseType)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case Webapp30Package.RESPECT_BINDING_TYPE__ENABLED: | |
setEnabled((TrueFalseType)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case Webapp30Package.RESPECT_BINDING_TYPE__ENABLED: | |
return enabled != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} //RespectBindingTypeImpl |