| /******************************************************************************* |
| * Copyright (c) 2013, 2017 CEA LIST 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(CEA LIST) - Initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.ocl.examples.codegen.cgmodel.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.jdt.annotation.NonNull; |
| import org.eclipse.jdt.annotation.Nullable; |
| import org.eclipse.ocl.examples.codegen.cgmodel.CGModelPackage; |
| import org.eclipse.ocl.examples.codegen.cgmodel.CGNavigationCallExp; |
| import org.eclipse.ocl.examples.codegen.cgmodel.CGValuedElement; |
| import org.eclipse.ocl.examples.codegen.utilities.EquivalenceUtil; |
| import org.eclipse.ocl.pivot.Property; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>CG Navigation Call Exp</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.ocl.examples.codegen.cgmodel.impl.CGNavigationCallExpImpl#getReferredProperty <em>Referred Property</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public abstract class CGNavigationCallExpImpl extends CGCallExpImpl implements CGNavigationCallExp { |
| /** |
| * The default value of the '{@link #getReferredProperty() <em>Referred Property</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getReferredProperty() |
| * @generated |
| * @ordered |
| */ |
| protected static final Property REFERRED_PROPERTY_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getReferredProperty() <em>Referred Property</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getReferredProperty() |
| * @generated |
| * @ordered |
| */ |
| protected Property referredProperty = REFERRED_PROPERTY_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CGNavigationCallExpImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CGModelPackage.Literals.CG_NAVIGATION_CALL_EXP; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Property getReferredProperty() { |
| return referredProperty; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setReferredProperty(Property newReferredProperty) { |
| Property oldReferredProperty = referredProperty; |
| referredProperty = newReferredProperty; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CGModelPackage.CG_NAVIGATION_CALL_EXP__REFERRED_PROPERTY, oldReferredProperty, referredProperty)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| return super.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case CGModelPackage.CG_NAVIGATION_CALL_EXP__REFERRED_PROPERTY: |
| return getReferredProperty(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case CGModelPackage.CG_NAVIGATION_CALL_EXP__REFERRED_PROPERTY: |
| setReferredProperty((Property)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case CGModelPackage.CG_NAVIGATION_CALL_EXP__REFERRED_PROPERTY: |
| setReferredProperty(REFERRED_PROPERTY_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CGModelPackage.CG_NAVIGATION_CALL_EXP__REFERRED_PROPERTY: |
| return REFERRED_PROPERTY_EDEFAULT == null ? referredProperty != null : !REFERRED_PROPERTY_EDEFAULT.equals(referredProperty); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public @Nullable Boolean isEquivalentToInternal(@NonNull CGValuedElement thatValue) { |
| return (getClass() == thatValue.getClass()) ? EquivalenceUtil.isEquivalent(this, (CGNavigationCallExp)thatValue) : null; |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isNonInvalid() { |
| CGValuedElement source = getSource(); |
| return source.isNonNull() && source.isNonInvalid(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isNonNull() { |
| return (referredProperty != null) && referredProperty.isIsRequired(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isNull() { |
| return false; |
| } |
| |
| |
| } //CGNavigationCallExpImpl |