org.eclipse.ocl.expressions.impl.EnumLiteralExpImpl 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: EnumLiteralExpImpl.java,v 1.8 2009/01/23 17:16:03 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.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.ocl.expressions.EnumLiteralExp;
import org.eclipse.ocl.expressions.ExpressionsPackage;
import org.eclipse.ocl.expressions.operations.EnumLiteralExpOperations;
import org.eclipse.ocl.utilities.Visitor;
/**
*
* An implementation of the model object 'Enum Literal Exp'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.ocl.expressions.impl.EnumLiteralExpImpl#getReferredEnumLiteral Referred Enum Literal}
*
*
*
* @generated
*/
public class EnumLiteralExpImpl
extends LiteralExpImpl
implements EnumLiteralExp {
/**
* The cached value of the '{@link #getReferredEnumLiteral() Referred Enum Literal}' reference.
*
*
* @see #getReferredEnumLiteral()
* @generated
* @ordered
*/
protected EL referredEnumLiteral;
/**
*
*
* @generated
*/
protected EnumLiteralExpImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ExpressionsPackage.Literals.ENUM_LITERAL_EXP;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
public EL getReferredEnumLiteral() {
if (referredEnumLiteral != null
&& ((EObject) referredEnumLiteral).eIsProxy()) {
InternalEObject oldReferredEnumLiteral = (InternalEObject) referredEnumLiteral;
referredEnumLiteral = (EL) eResolveProxy(oldReferredEnumLiteral);
if (referredEnumLiteral != oldReferredEnumLiteral) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(
this,
Notification.RESOLVE,
ExpressionsPackage.ENUM_LITERAL_EXP__REFERRED_ENUM_LITERAL,
oldReferredEnumLiteral, referredEnumLiteral));
}
}
return referredEnumLiteral;
}
/**
*
*
* @generated
*/
public EL basicGetReferredEnumLiteral() {
return referredEnumLiteral;
}
/**
*
*
* @generated
*/
public void setReferredEnumLiteral(EL newReferredEnumLiteral) {
EL oldReferredEnumLiteral = referredEnumLiteral;
referredEnumLiteral = newReferredEnumLiteral;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
ExpressionsPackage.ENUM_LITERAL_EXP__REFERRED_ENUM_LITERAL,
oldReferredEnumLiteral, referredEnumLiteral));
}
/**
*
*
* @generated
*/
public boolean checkEnumType(DiagnosticChain diagnostics,
Map