org.eclipse.ocl.expressions.impl.VariableExpImpl Maven / Gradle / Ivy
/**
*
*
* Copyright (c) 2006, 2009 IBM Corporation, Zeligsoft Inc., 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:
* IBM - Initial API and implementation
* Zeligsoft - Bug 207365
*
*
*
* $Id: VariableExpImpl.java,v 1.8 2009/01/23 17:16:04 cdamus Exp $
*/
package org.eclipse.ocl.expressions.impl;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.ocl.expressions.ExpressionsPackage;
import org.eclipse.ocl.expressions.Variable;
import org.eclipse.ocl.expressions.VariableExp;
import org.eclipse.ocl.expressions.operations.VariableExpOperations;
import org.eclipse.ocl.utilities.Visitor;
/**
*
* An implementation of the model object 'Variable Exp'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.ocl.expressions.impl.VariableExpImpl#getReferredVariable Referred Variable}
*
*
*
* @generated
*/
public class VariableExpImpl
extends OCLExpressionImpl
implements VariableExp {
/**
* The cached value of the '{@link #getReferredVariable() Referred Variable}' reference.
*
*
* @see #getReferredVariable()
* @generated
* @ordered
*/
protected Variable referredVariable;
/**
*
*
* @generated
*/
protected VariableExpImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ExpressionsPackage.Literals.VARIABLE_EXP;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
public Variable getReferredVariable() {
if (referredVariable != null && referredVariable.eIsProxy()) {
InternalEObject oldReferredVariable = (InternalEObject) referredVariable;
referredVariable = (Variable) eResolveProxy(oldReferredVariable);
if (referredVariable != oldReferredVariable) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
ExpressionsPackage.VARIABLE_EXP__REFERRED_VARIABLE,
oldReferredVariable, referredVariable));
}
}
return referredVariable;
}
/**
*
*
* @generated
*/
public Variable basicGetReferredVariable() {
return referredVariable;
}
/**
*
*
* @generated
*/
public void setReferredVariable(Variable newReferredVariable) {
Variable oldReferredVariable = referredVariable;
referredVariable = newReferredVariable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
ExpressionsPackage.VARIABLE_EXP__REFERRED_VARIABLE,
oldReferredVariable, referredVariable));
}
/**
*
*
* @generated
*/
public boolean checkVarType(DiagnosticChain diagnostics,
Map