blob: 14a2f96f4ad8031d4fd0b8e5f7442d01df09f066 [file] [log] [blame]
/**
* Copyright (c) 2010, 2018 Willink Transformations and others.
* 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:
* E.D.Willink - Initial API and implementation
*/
package org.eclipse.qvtd.xtext.qvtbasecs.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.ocl.xtext.basecs.impl.ElementCSImpl;
import org.eclipse.qvtd.xtext.qvtbasecs.JavaClassCS;
import org.eclipse.qvtd.xtext.qvtbasecs.JavaImplementationCS;
import org.eclipse.qvtd.xtext.qvtbasecs.QVTbaseCSPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Java Implementation CS</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.qvtd.xtext.qvtbasecs.impl.JavaImplementationCSImpl#getImplementation <em>Implementation</em>}</li>
* </ul>
*
* @generated
*/
public abstract class JavaImplementationCSImpl extends ElementCSImpl implements JavaImplementationCS
{
/**
* The number of structural features of the '<em>Java Implementation CS</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
public static final int JAVA_IMPLEMENTATION_CS_FEATURE_COUNT = ElementCSImpl.ELEMENT_CS_FEATURE_COUNT + 1;
/**
* The cached value of the '{@link #getImplementation() <em>Implementation</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getImplementation()
* @generated
* @ordered
*/
protected JavaClassCS implementation;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected JavaImplementationCSImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return QVTbaseCSPackage.Literals.JAVA_IMPLEMENTATION_CS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public JavaClassCS getImplementation()
{
if (implementation != null && implementation.eIsProxy())
{
InternalEObject oldImplementation = (InternalEObject)implementation;
implementation = (JavaClassCS)eResolveProxy(oldImplementation);
if (implementation != oldImplementation)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ElementCSImpl.ELEMENT_CS_FEATURE_COUNT + 0, oldImplementation, implementation));
}
}
return implementation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public JavaClassCS basicGetImplementation()
{
return implementation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setImplementation(JavaClassCS newImplementation)
{
JavaClassCS oldImplementation = implementation;
implementation = newImplementation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ElementCSImpl.ELEMENT_CS_FEATURE_COUNT + 0, oldImplementation, implementation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case ElementCSImpl.ELEMENT_CS_FEATURE_COUNT + 0:
if (resolve) return getImplementation();
return basicGetImplementation();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case ElementCSImpl.ELEMENT_CS_FEATURE_COUNT + 0:
setImplementation((JavaClassCS)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case ElementCSImpl.ELEMENT_CS_FEATURE_COUNT + 0:
setImplementation((JavaClassCS)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case ElementCSImpl.ELEMENT_CS_FEATURE_COUNT + 0:
return implementation != null;
}
return super.eIsSet(featureID);
}
} //JavaImplementationCSImpl