| /******************************************************************************* |
| * Copyright (c) 2010, 2012 E.D.Willink and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * E.D.Willink - initial API and implementation |
| *******************************************************************************/ |
| |
| package org.eclipse.ocl.xtext.oclstdlibcs.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.jdt.annotation.NonNull; |
| import org.eclipse.jdt.annotation.Nullable; |
| import org.eclipse.ocl.xtext.basecs.impl.AttributeCSImpl; |
| import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor; |
| import org.eclipse.ocl.xtext.oclstdlibcs.JavaClassCS; |
| import org.eclipse.ocl.xtext.oclstdlibcs.JavaImplementationCS; |
| import org.eclipse.ocl.xtext.oclstdlibcs.LibPropertyCS; |
| import org.eclipse.ocl.xtext.oclstdlibcs.OCLstdlibCSPackage; |
| import org.eclipse.ocl.xtext.oclstdlibcs.util.OCLstdlibCSVisitor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Lib Property CS</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.ocl.xtext.oclstdlibcs.impl.LibPropertyCSImpl#getImplementation <em>Implementation</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class LibPropertyCSImpl |
| extends AttributeCSImpl |
| implements LibPropertyCS { |
| |
| /** |
| * 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 LibPropertyCSImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return OCLstdlibCSPackage.Literals.LIB_PROPERTY_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, OCLstdlibCSPackage.LIB_PROPERTY_CS__IMPLEMENTATION, 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, OCLstdlibCSPackage.LIB_PROPERTY_CS__IMPLEMENTATION, oldImplementation, implementation)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) |
| { |
| case OCLstdlibCSPackage.LIB_PROPERTY_CS__IMPLEMENTATION: |
| 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 OCLstdlibCSPackage.LIB_PROPERTY_CS__IMPLEMENTATION: |
| setImplementation((JavaClassCS)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) |
| { |
| case OCLstdlibCSPackage.LIB_PROPERTY_CS__IMPLEMENTATION: |
| setImplementation((JavaClassCS)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) |
| { |
| case OCLstdlibCSPackage.LIB_PROPERTY_CS__IMPLEMENTATION: |
| return implementation != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == JavaImplementationCS.class) |
| { |
| switch (derivedFeatureID) |
| { |
| case OCLstdlibCSPackage.LIB_PROPERTY_CS__IMPLEMENTATION: return OCLstdlibCSPackage.JAVA_IMPLEMENTATION_CS__IMPLEMENTATION; |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == JavaImplementationCS.class) |
| { |
| switch (baseFeatureID) |
| { |
| case OCLstdlibCSPackage.JAVA_IMPLEMENTATION_CS__IMPLEMENTATION: return OCLstdlibCSPackage.LIB_PROPERTY_CS__IMPLEMENTATION; |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public @Nullable <R> R accept(@NonNull BaseCSVisitor<R> visitor) { |
| return (R) ((OCLstdlibCSVisitor<?>)visitor).visitLibPropertyCS(this); |
| } |
| } //LibPropertyCSImpl |