/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.dresdenocl.examples.pml.impl;
import org.eclipse.emf.common.notify.Notification;
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.dresdenocl.examples.pml.Extension;
import org.dresdenocl.examples.pml.ExtensionPoint;
import org.dresdenocl.examples.pml.JavaType;
import org.dresdenocl.examples.pml.PmlPackage;
/**
* <!-- begin-user-doc --> An implementation of the model object '
* <em><b>Extension</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.dresdenocl.examples.pml.impl.ExtensionImpl#getImplementation <em>Implementation</em>}</li>
* <li>{@link org.dresdenocl.examples.pml.impl.ExtensionImpl#getExtensionPoint <em>Extension Point</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ExtensionImpl extends EObjectImpl implements Extension {
/**
* The cached value of the '{@link #getImplementation() <em>Implementation</em>}' reference.
* <!-- begin-user-doc --> <!--
* end-user-doc -->
* @see #getImplementation()
* @generated
* @ordered
*/
protected JavaType implementation;
/**
* The cached value of the '{@link #getExtensionPoint() <em>Extension Point</em>}' reference.
* <!-- begin-user-doc --> <!--
* end-user-doc -->
* @see #getExtensionPoint()
* @generated
* @ordered
*/
protected ExtensionPoint extensionPoint;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
protected ExtensionImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return PmlPackage.Literals.EXTENSION;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public JavaType getImplementation() {
if (implementation != null && implementation.eIsProxy()) {
InternalEObject oldImplementation = (InternalEObject)implementation;
implementation = (JavaType)eResolveProxy(oldImplementation);
if (implementation != oldImplementation) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PmlPackage.EXTENSION__IMPLEMENTATION, oldImplementation, implementation));
}
}
return implementation;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public JavaType basicGetImplementation() {
return implementation;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public void setImplementation(JavaType newImplementation) {
JavaType oldImplementation = implementation;
implementation = newImplementation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PmlPackage.EXTENSION__IMPLEMENTATION, oldImplementation, implementation));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public ExtensionPoint getExtensionPoint() {
if (extensionPoint != null && extensionPoint.eIsProxy()) {
InternalEObject oldExtensionPoint = (InternalEObject)extensionPoint;
extensionPoint = (ExtensionPoint)eResolveProxy(oldExtensionPoint);
if (extensionPoint != oldExtensionPoint) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PmlPackage.EXTENSION__EXTENSION_POINT, oldExtensionPoint, extensionPoint));
}
}
return extensionPoint;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public ExtensionPoint basicGetExtensionPoint() {
return extensionPoint;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public void setExtensionPoint(ExtensionPoint newExtensionPoint) {
ExtensionPoint oldExtensionPoint = extensionPoint;
extensionPoint = newExtensionPoint;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PmlPackage.EXTENSION__EXTENSION_POINT, oldExtensionPoint, extensionPoint));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case PmlPackage.EXTENSION__IMPLEMENTATION:
if (resolve) return getImplementation();
return basicGetImplementation();
case PmlPackage.EXTENSION__EXTENSION_POINT:
if (resolve) return getExtensionPoint();
return basicGetExtensionPoint();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case PmlPackage.EXTENSION__IMPLEMENTATION:
setImplementation((JavaType)newValue);
return;
case PmlPackage.EXTENSION__EXTENSION_POINT:
setExtensionPoint((ExtensionPoint)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case PmlPackage.EXTENSION__IMPLEMENTATION:
setImplementation((JavaType)null);
return;
case PmlPackage.EXTENSION__EXTENSION_POINT:
setExtensionPoint((ExtensionPoint)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case PmlPackage.EXTENSION__IMPLEMENTATION:
return implementation != null;
case PmlPackage.EXTENSION__EXTENSION_POINT:
return extensionPoint != null;
}
return super.eIsSet(featureID);
}
/*
* (non-Javadoc)
* @see org.eclipse.emf.ecore.impl.BasicEObjectImpl#toString()
* @generated NOT
*/
public String toString() {
String result;
result = this.getClass().getSimpleName();
result += "[";
if (implementation != null) {
result += "implementation = " + implementation.getFullyQualifiedName();
}
// no else.
if (extensionPoint != null) {
result += ", extensionPoint = " + extensionPoint.getId();
}
// no else.
result += "]";
return result;
}
} // ExtensionImpl